Class: OTX::Type::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/otx_ruby/base.rb

Overview

Base Class for types

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Base

Returns a new instance of Base.



102
103
104
105
106
107
108
109
110
111
112
# File 'lib/otx_ruby/base.rb', line 102

def initialize(attributes={})
  attributes.each do |key, value|
    _key = key.gsub('-', '_')

    unless self.respond_to?(_key.downcase)
      self.class.send(:attr_accessor, _key.downcase)
    end

    send("#{_key.downcase}=", value)
  end
end

Instance Attribute Details

#createdDateTime

Date and Time stamp for the creation of the records

Returns:

  • (DateTime)

    the current value of created



90
91
92
# File 'lib/otx_ruby/base.rb', line 90

def created
  @created
end

#idObject

Returns the value of attribute id.



92
93
94
# File 'lib/otx_ruby/base.rb', line 92

def id
  @id
end

#modifiedDateTime

Date and Time stamp for the last modification of the records

Returns:

  • (DateTime)

    the current value of modified



90
91
92
# File 'lib/otx_ruby/base.rb', line 90

def modified
  @modified
end