Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/burlap/core_ext/object.rb
Instance Method Summary collapse
Instance Method Details
#to_burlap ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/burlap/core_ext/object.rb', line 2 def to_burlap dict = {} vars = instance_variables.map do |var| key = var[/^@(.*)$/, 1] value = instance_variable_get(var) [key, value] end.sort_by {|e| e.first } Burlap::Hash[vars, self.class.to_s].to_burlap end |