Class: Karaden::Model::KaradenObject

Inherits:
Object
  • Object
show all
Defined in:
lib/karaden/model/karaden_object.rb

Direct Known Subclasses

Collection, Error, Requestable

Instance Method Summary collapse

Constructor Details

#initialize(id = nil, request_options = nil) ⇒ KaradenObject

Returns a new instance of KaradenObject.



4
5
6
7
8
# File 'lib/karaden/model/karaden_object.rb', line 4

def initialize(id = nil, request_options = nil)
  @properties = {}
  @request_options = request_options
  set_property('id', id)
end

Instance Method Details

#idObject



10
11
12
# File 'lib/karaden/model/karaden_object.rb', line 10

def id()
  property('id')
end

#objectObject



14
15
16
# File 'lib/karaden/model/karaden_object.rb', line 14

def object()
  property('object')
end

#property(key) ⇒ Object



26
27
28
# File 'lib/karaden/model/karaden_object.rb', line 26

def property(key)
  @properties[key]
end

#property_keysObject



22
23
24
# File 'lib/karaden/model/karaden_object.rb', line 22

def property_keys()
  @properties.keys
end

#set_property(key, value) ⇒ Object



18
19
20
# File 'lib/karaden/model/karaden_object.rb', line 18

def set_property(key, value)
  @properties[key] = value
end