Class: Hiptest::Nodes::Folder

Inherits:
Node
  • Object
show all
Defined in:
lib/hiptest-publisher/nodes.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #parent

Instance Method Summary collapse

Methods inherited from Node

#==, #each_direct_children, #each_sub_nodes, #kind, #pretty_print_instance_variables, #project, #render

Constructor Details

#initialize(uid, parent_uid, name, description, tags = []) ⇒ Folder

Returns a new instance of Folder.



387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/hiptest-publisher/nodes.rb', line 387

def initialize(uid, parent_uid, name, description, tags = [])
  super()

  @uid = uid
  @parent_uid = parent_uid

  @children = {
    :name => name,
    :description => description,
    :subfolders => [],
    :scenarios => [],
    :tags => tags
  }
end

Instance Attribute Details

#parent_uidObject (readonly)

Returns the value of attribute parent_uid.



385
386
387
# File 'lib/hiptest-publisher/nodes.rb', line 385

def parent_uid
  @parent_uid
end

#uidObject (readonly)

Returns the value of attribute uid.



385
386
387
# File 'lib/hiptest-publisher/nodes.rb', line 385

def uid
  @uid
end

Instance Method Details

#folderObject



406
407
408
# File 'lib/hiptest-publisher/nodes.rb', line 406

def folder
  root? ? nil : parent
end

#root?Boolean

Returns:

  • (Boolean)


402
403
404
# File 'lib/hiptest-publisher/nodes.rb', line 402

def root?
  parent_uid == nil
end