class Hiptest::Nodes::Folder

Attributes

order_in_parent[R]
parent_uid[R]
uid[R]

Public Class Methods

new(uid, parent_uid, name, description, tags = [], order_in_parent = 0, body = []) click to toggle source
Calls superclass method
# File lib/hiptest-publisher/nodes.rb, line 481
def initialize(uid, parent_uid, name, description, tags = [], 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: tags,
    body: body
  }
end

Public Instance Methods

ancestors() click to toggle source
# 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() click to toggle source
# File lib/hiptest-publisher/nodes.rb, line 501
def folder
  root? ? nil : parent
end
root?() click to toggle source
# File lib/hiptest-publisher/nodes.rb, line 497
def root?
  parent_uid == nil
end