Class: JasmineParser::SharedBehaviorDeclaration
- Defined in:
- lib/jasmine-parser/nodes/shared_behavior_decl_node.rb
Instance Attribute Summary
Attributes inherited from Node
#children, #filename, #js_object, #line, #name, #parent
Instance Method Summary collapse
-
#delete! ⇒ Object
TODO: Export delete! to module ToDo: write tests for delete method.
-
#ready_to_be_adopted? ⇒ Boolean
ToDo: write tests for ready_to_be_adopted?.
- #type ⇒ Object
Methods inherited from Node
#clone, #formatted_name, function_invocation, group, #initialize, it, root, shared_behavior_declaration, shared_behavior_invocation
Constructor Details
This class inherits a constructor from JasmineParser::Node
Instance Method Details
#delete! ⇒ Object
TODO: Export delete! to module ToDo: write tests for delete method
39 40 41 42 |
# File 'lib/jasmine-parser/nodes/shared_behavior_decl_node.rb', line 39 def delete! self.parent.children.delete(self) self.parent = nil end |
#ready_to_be_adopted? ⇒ Boolean
ToDo: write tests for ready_to_be_adopted?
45 46 47 48 49 50 51 |
# File 'lib/jasmine-parser/nodes/shared_behavior_decl_node.rb', line 45 def ready_to_be_adopted? not_ready_to_be_adopted = children.collect do |child| child if child.type == :shared_behavior_invocation and child.ready_to_be_adopted? == false end.compact not_ready_to_be_adopted.empty? end |
#type ⇒ Object
33 34 35 |
# File 'lib/jasmine-parser/nodes/shared_behavior_decl_node.rb', line 33 def type :shared_behavior_declaration end |