Class: Kafo::ParamGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/kafo/param_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ ParamGroup

Returns a new instance of ParamGroup.



9
10
11
12
13
# File 'lib/kafo/param_group.rb', line 9

def initialize(name)
  @children = []
  @params   = []
  @name     = name
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



5
6
7
# File 'lib/kafo/param_group.rb', line 5

def children
  @children
end

#moduleObject

Returns the value of attribute module.



6
7
8
# File 'lib/kafo/param_group.rb', line 6

def module
  @module
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/kafo/param_group.rb', line 5

def name
  @name
end

#paramsObject (readonly)

Returns the value of attribute params.



5
6
7
# File 'lib/kafo/param_group.rb', line 5

def params
  @params
end

Instance Method Details

#add_child(group) ⇒ Object



19
20
21
# File 'lib/kafo/param_group.rb', line 19

def add_child(group)
  @children.push group unless @children.include?(group)
end

#add_param(param) ⇒ Object



23
24
25
# File 'lib/kafo/param_group.rb', line 23

def add_param(param)
  @params.push param unless @params.include?(param)
end

#formatted_nameObject



15
16
17
# File 'lib/kafo/param_group.rb', line 15

def formatted_name
  @formatted_name ||= @name.sub(/:\Z/,'')
end