Class: Options::Option::Builder
- Inherits:
-
Object
- Object
- Options::Option::Builder
- Defined in:
- lib/bujo/options/option.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
- #valued(value_type = String) ⇒ Object
- #with_action(action) ⇒ Object
- #with_description(description) ⇒ Object
- #with_name(short_name = nil, long_name) ⇒ Object
Constructor Details
#initialize ⇒ Builder
Returns a new instance of Builder.
22 23 24 |
# File 'lib/bujo/options/option.rb', line 22 def initialize @shortcuts = [] end |
Instance Method Details
#build ⇒ Object
47 48 49 |
# File 'lib/bujo/options/option.rb', line 47 def build Option.new(@short_name, @long_name, @description, @value_type, @action) end |
#valued(value_type = String) ⇒ Object
37 38 39 40 |
# File 'lib/bujo/options/option.rb', line 37 def valued(value_type = String) @value_type = value_type self end |
#with_action(action) ⇒ Object
42 43 44 45 |
# File 'lib/bujo/options/option.rb', line 42 def with_action(action) @action = action self end |
#with_description(description) ⇒ Object
32 33 34 35 |
# File 'lib/bujo/options/option.rb', line 32 def with_description(description) @description = description self end |
#with_name(short_name = nil, long_name) ⇒ Object
26 27 28 29 30 |
# File 'lib/bujo/options/option.rb', line 26 def with_name(short_name = nil, long_name) @short_name = short_name @long_name = long_name self end |