Class: Kafo::ParamGroup
- Inherits:
-
Object
- Object
- Kafo::ParamGroup
- Defined in:
- lib/kafo/param_group.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#module ⇒ Object
Returns the value of attribute module.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #add_child(group) ⇒ Object
- #add_param(param) ⇒ Object
- #formatted_name ⇒ Object
-
#initialize(name) ⇒ ParamGroup
constructor
A new instance of ParamGroup.
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
#children ⇒ Object (readonly)
Returns the value of attribute children.
5 6 7 |
# File 'lib/kafo/param_group.rb', line 5 def children @children end |
#module ⇒ Object
Returns the value of attribute module.
6 7 8 |
# File 'lib/kafo/param_group.rb', line 6 def module @module end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/kafo/param_group.rb', line 5 def name @name end |
#params ⇒ Object (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_name ⇒ Object
15 16 17 |
# File 'lib/kafo/param_group.rb', line 15 def formatted_name @formatted_name ||= @name.sub(/:\Z/,'') end |