Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/rmxp_extractor/ron.rb,
lib/rmxp_extractor/classnames.rb
Instance Method Summary collapse
Instance Method Details
#from_rmxp_serialize(hash) ⇒ Object
39 40 41 42 |
# File 'lib/rmxp_extractor/classnames.rb', line 39 def from_rmxp_serialize(hash) hash.each { |key, value| self.instance_variable_set("@#{key}", create_from_rmxp_serialize(value)) } self end |
#rmxp_serialize ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/rmxp_extractor/ron.rb', line 7 def rmxp_serialize $indent += 2 str = "#{self.class.name.split("::").last}(\n" self.instance_variables.sort.each { |var| str += "#{" " * $indent}#{var.to_s.delete("@")}: #{self.instance_variable_get(var).rmxp_serialize},\n" } $indent -= 2 str += "#{" " * $indent})" str end |