Skip to content

Commit

Permalink
Merge pull request #7 from Moesif/add-direction-field-to-event
Browse files Browse the repository at this point in the history
Add: direction field to Event Model
  • Loading branch information
dgilling authored Dec 13, 2019
2 parents 851aaed + 8014da9 commit a0484fc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
moesif_api (1.2.9)
moesif_api (1.2.10)
json_mapper (~> 0.2.1)
moesif_unirest (~> 1.1.5)
test-unit (~> 3.1.5)
Expand Down
2 changes: 1 addition & 1 deletion lib/moesif_api/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Configuration
# Your Application Id for authentication/authorization
@application_id = 'SET_ME'

@version = '1.2.9'
@version = '1.2.10'

# create the getters and setters
class << self
Expand Down
13 changes: 11 additions & 2 deletions lib/moesif_api/models/event_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class EventModel < BaseModel
# @return [Hash]
attr_accessor :metadata

# direction string
# @return [String]
attr_accessor :direction

# A mapping from model property names to API property names
def self.names
if @hash.nil?
Expand All @@ -41,6 +45,7 @@ def self.names
@hash["user_id"] = "user_id"
@hash["company_id"] = "company_id"
@hash["metadata"] = "metadata"
@hash["direction"] = "direction"
end
@hash
end
Expand All @@ -51,14 +56,16 @@ def initialize(request = nil,
tags = nil,
user_id = nil,
company_id = nil,
metadata = nil)
metadata = nil,
direction = nil)
@request = request
@response = response
@session_token = session_token
@tags = tags
@user_id = user_id
@company_id = company_id
@metadata = metadata
@direction = direction
end

# Creates an instance of the object from a hash
Expand All @@ -74,6 +81,7 @@ def self.from_hash(hash)
user_id = hash["user_id"]
company_id = hash["company_id"]
metadata = hash["metadata"]
direction = hash["direction"]

# Create object from extracted values
EventModel.new(request,
Expand All @@ -82,7 +90,8 @@ def self.from_hash(hash)
tags,
user_id,
company_id,
metadata)
metadata,
direction)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion moesif_api.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'moesif_api'
s.version = '1.2.9'
s.version = '1.2.10'
s.summary = 'moesif_api'
s.description = 'Collection/Data Ingestion API'
s.authors = ['Moesif, Inc', 'Derric Gilling']
Expand Down

0 comments on commit a0484fc

Please sign in to comment.