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 15 16 17 18 |
# File 'lib/embedly/model.rb', line 6 def initialize obj if obj o = obj.clone o.each do |k,v| if v.is_a?Hash o[k] = Embedly::EmbedlyObject.new v end end super o else super end end |
Instance Method Details
#marshal_dump ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/embedly/model.rb', line 26 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.
22 23 24 |
# File 'lib/embedly/model.rb', line 22 def type method_missing :type end |