Class: Cupid::Response::DataFolder
- Defined in:
- lib/cupid/response/data_folder.rb
Constant Summary collapse
- ALL =
[]
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Attributes inherited from Object
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ DataFolder
constructor
A new instance of DataFolder.
- #root? ⇒ Boolean
Methods inherited from Object
#==, #[], #call, fields, #type
Constructor Details
#initialize(data) ⇒ DataFolder
Returns a new instance of DataFolder.
19 20 21 22 23 24 |
# File 'lib/cupid/response/data_folder.rb', line 19 def initialize(data) super assign_children extract_parent add_to_identity_map end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
8 9 10 |
# File 'lib/cupid/response/data_folder.rb', line 8 def children @children end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
8 9 10 |
# File 'lib/cupid/response/data_folder.rb', line 8 def parent @parent end |
Class Method Details
.find(id) ⇒ Object
15 16 17 |
# File 'lib/cupid/response/data_folder.rb', line 15 def self.find(id) ALL.find {|it| it.id == id } end |
.new(data) ⇒ Object
11 12 13 |
# File 'lib/cupid/response/data_folder.rb', line 11 def self.new(data) find(data[:id]) || super end |
Instance Method Details
#root? ⇒ Boolean
26 27 28 |
# File 'lib/cupid/response/data_folder.rb', line 26 def root? not parent end |