Class: Embedly::EmbedlyObject
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Embedly::EmbedlyObject
- Defined in:
- lib/embedly/model.rb
Instance Method Summary collapse
-
#initialize(obj) ⇒ EmbedlyObject
constructor
Resursively make ostruct.
- #marshal_dump ⇒ Object
-
#type ⇒ Object
for ruby 1.8.x, type should return @table, not the class.
Constructor Details
#initialize(obj) ⇒ EmbedlyObject
Resursively make ostruct
6 7 8 9 10 11 12 13 14 |
# File 'lib/embedly/model.rb', line 6 def initialize obj o = obj.clone o.each do |k,v| if v.is_a?Hash o[k] = Embedly::EmbedlyObject.new v end end super o end |
Instance Method Details
#marshal_dump ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/embedly/model.rb', line 22 def marshal_dump o = @table.clone o.each do |k,v| if v.is_a?Embedly::EmbedlyObject o[k] = v.marshal_dump end end return o end |
#type ⇒ Object
for ruby 1.8.x, type should return @table, not the class.
18 19 20 |
# File 'lib/embedly/model.rb', line 18 def type method_missing :type end |