Class: CaseGen::Set
- Inherits:
-
Object
- Object
- CaseGen::Set
- Defined in:
- lib/case_gen/set.rb
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #hash_pairs ⇒ Object
-
#initialize(title, values) ⇒ Set
constructor
A new instance of Set.
Constructor Details
#initialize(title, values) ⇒ Set
Returns a new instance of Set.
7 8 9 10 |
# File 'lib/case_gen/set.rb', line 7 def initialize(title, values) @title = title @values = values end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/case_gen/set.rb', line 5 def title @title end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
5 6 7 |
# File 'lib/case_gen/set.rb', line 5 def values @values end |
Instance Method Details
#hash_pairs ⇒ Object
12 13 14 |
# File 'lib/case_gen/set.rb', line 12 def hash_pairs @values.map { |v| {@title => v} } end |