Class: Hiptest::Nodes::Folder
- Defined in:
- lib/hiptest-publisher/nodes.rb
Instance Attribute Summary collapse
-
#order_in_parent ⇒ Object
readonly
Returns the value of attribute order_in_parent.
-
#parent_uid ⇒ Object
readonly
Returns the value of attribute parent_uid.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
Attributes inherited from Node
Instance Method Summary collapse
- #ancestors ⇒ Object
- #folder ⇒ Object
-
#initialize(uid, parent_uid, name, description, tags = [], order_in_parent = 0, body = []) ⇒ Folder
constructor
A new instance of Folder.
- #root? ⇒ Boolean
Methods inherited from Node
#==, #each_direct_children, #each_sub_nodes, #flat_string, #kind, #pretty_print_instance_variables, #project, #render
Constructor Details
#initialize(uid, parent_uid, name, description, tags = [], order_in_parent = 0, body = []) ⇒ Folder
Returns a new instance of Folder.
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 |
# File 'lib/hiptest-publisher/nodes.rb', line 481 def initialize(uid, parent_uid, name, description, = [], order_in_parent = 0, body = []) super() @uid = uid @parent_uid = parent_uid @order_in_parent = order_in_parent @children = { name: name, description: description, subfolders: [], scenarios: [], tags: , body: body } end |
Instance Attribute Details
#order_in_parent ⇒ Object (readonly)
Returns the value of attribute order_in_parent.
479 480 481 |
# File 'lib/hiptest-publisher/nodes.rb', line 479 def order_in_parent @order_in_parent end |
#parent_uid ⇒ Object (readonly)
Returns the value of attribute parent_uid.
479 480 481 |
# File 'lib/hiptest-publisher/nodes.rb', line 479 def parent_uid @parent_uid end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
479 480 481 |
# File 'lib/hiptest-publisher/nodes.rb', line 479 def uid @uid end |
Instance Method Details
#ancestors ⇒ Object
505 506 507 508 509 510 511 512 513 514 515 |
# File 'lib/hiptest-publisher/nodes.rb', line 505 def ancestors ancestors = [] current_ancestor = folder until current_ancestor.nil? ancestors << current_ancestor current_ancestor = current_ancestor.folder end ancestors end |
#folder ⇒ Object
501 502 503 |
# File 'lib/hiptest-publisher/nodes.rb', line 501 def folder root? ? nil : parent end |
#root? ⇒ Boolean
497 498 499 |
# File 'lib/hiptest-publisher/nodes.rb', line 497 def root? parent_uid == nil end |