Class: Ryo::Object
- Inherits:
-
Object
- Object
- Ryo::Object
- Defined in:
- lib/ryo/object.rb
Overview
Ryo::Object is a Ryo object and subclass of Ruby's Object class that can be created by using Ryo(), Ryo.Object(), Ryo::Object.from, or Ryo::Object.create.
Class Method Summary collapse
-
.create(props, prototype = nil) ⇒ Ryo::Object
Returns an instance of Ryo::Object.
-
.from(props, prototype = nil) ⇒ Ryo::Object
Creates a Ryo object by recursively walking a Hash object.
Instance Method Summary collapse
-
#initialize_dup(ryo) ⇒ Ryo::Object
Duplicates the internals of a Ryo object.
Class Method Details
.create(props, prototype = nil) ⇒ Ryo::Object
Returns an instance of Ryo::Object
15 16 17 |
# File 'lib/ryo/object.rb', line 15 def self.create(props, prototype = nil) Ryo::Builder.build(self, props, prototype) end |
.from(props, prototype = nil) ⇒ Ryo::Object
Creates a Ryo object by recursively walking a Hash object
26 27 28 |
# File 'lib/ryo/object.rb', line 26 def self.from(props, prototype = nil) Ryo::Builder.recursive_build(self, props, prototype) end |
Instance Method Details
#initialize_dup(ryo) ⇒ Ryo::Object
Duplicates the internals of a Ryo object
37 38 39 40 |
# File 'lib/ryo/object.rb', line 37 def initialize_dup(ryo) Ryo.set_table_of(self, Ryo.table_of(ryo).dup) Ryo.extend!(self, Ryo) end |