Class: Teamsupport::Identity
Instance Attribute Summary collapse
-
#ID ⇒ Integer
readonly
Method for reading the TeamSupport ID of an object.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Teamsupport::Identity
constructor
private
Initializes a new object.
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, object_attr_reader, predicate_attr_reader
Methods included from Utils
Constructor Details
#initialize(attrs = {}) ⇒ Teamsupport::Identity
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes a new object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/teamsupport/identity.rb', line 29 def initialize(attrs = {}) # Workaround for dealing with TeamSupport API inconsistently sending ID for objects unless attrs[:ID] attrs[:ID] = attrs.fetch(:OrganizationID) if attrs[:OrganizationID] attrs[:ID] = attrs.fetch(:ProductID) if attrs[:ProductID] attrs[:ID] = attrs.fetch(:TicketID) if attrs[:TicketID] end attrs.fetch(:ID) super end |
Instance Attribute Details
#ID ⇒ Integer (readonly)
Method for reading the TeamSupport ID of an object
18 19 20 |
# File 'lib/teamsupport/identity.rb', line 18 def ID @ID end |