Class: OpenSocial::AppData
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id, json) ⇒ AppData
constructor
Initializes the AppData entry based on the provided id and json fragment.
Methods inherited from Base
Constructor Details
#initialize(id, json) ⇒ AppData
Initializes the AppData entry based on the provided id and json fragment. If no JSON is provided, an empty object (with only an ID) is created.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/opensocial/appdata.rb', line 34 def initialize(id, json) @id = id if json json.each do |key, value| begin self.send("#{key}=", value) rescue NoMethodError add_attr(key) self.send("#{key}=", value) end end end end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
30 31 32 |
# File 'lib/opensocial/appdata.rb', line 30 def id @id end |