Class: MetaBuilder::ParameterGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/MetaBuilder/group.rb

Overview

The ParameterGroup class provides an easy way to group parameters of a described class. The group should have a #name, a #long_name, more descriptive and a description.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, long_name = name, description = nil) ⇒ ParameterGroup

Returns a new instance of ParameterGroup.



43
44
45
46
47
48
49
# File 'lib/MetaBuilder/group.rb', line 43

def initialize(name, long_name = name, 
               description = nil)
  @name = name
  @description = description
  @long_name = long_name
  @parameter_list = []
end

Instance Attribute Details

#descriptionObject

The (text) description of the group



36
37
38
# File 'lib/MetaBuilder/group.rb', line 36

def description
  @description
end

#long_nameObject

The long name of the group



33
34
35
# File 'lib/MetaBuilder/group.rb', line 33

def long_name
  @long_name
end

#nameObject

The short name of the group



30
31
32
# File 'lib/MetaBuilder/group.rb', line 30

def name
  @name
end

#parameter_listObject

The list of parameters in that group, in the order they were declared.



41
42
43
# File 'lib/MetaBuilder/group.rb', line 41

def parameter_list
  @parameter_list
end

Instance Method Details

#add_parameter(param) ⇒ Object



51
52
53
# File 'lib/MetaBuilder/group.rb', line 51

def add_parameter(param)
  @parameter_list << param
end