Class: OpenStruct
Instance Method Summary collapse
- #__js_enumerate ⇒ Object
- #__to_json ⇒ Object
-
#to_ruby(depth = 0) ⇒ Object
OpenStruct converts to plain ruby hash in depth.
Instance Method Details
#__js_enumerate ⇒ Object
41 42 43 |
# File 'lib/h8/context.rb', line 41 def __js_enumerate to_h.keys.map(&:to_s) end |
#__to_json ⇒ Object
37 38 39 |
# File 'lib/h8/context.rb', line 37 def __to_json JSON.unparse to_h end |
#to_ruby(depth = 0) ⇒ Object
OpenStruct converts to plain ruby hash in depth. Primary usage is when it was used bu javascript and could contain gated objects.
191 192 193 |
# File 'lib/h8/value.rb', line 191 def to_ruby depth=0 to_h.to_ruby depth+1 end |