class OTX::Type::Base

Base Class for types

@attr [DateTime] created Date and Time stamp for the creation of the records @attr [DateTime] modified Date and Time stamp for the last modification of the records

Attributes

created[W]
id[RW]
modified[W]

Public Class Methods

new(attributes={}) click to toggle source
# 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

Public Instance Methods

created() click to toggle source
# File lib/otx_ruby/base.rb, line 94
def created
  return @created.nil? ? nil : DateTime.parse(@created)
end
modified() click to toggle source
# File lib/otx_ruby/base.rb, line 98
def modified
  return @modified.nil? ? nil : DateTime.parse(@modified)
end