Class: Cmdopt::Builder
- Inherits:
-
Object
- Object
- Cmdopt::Builder
- Defined in:
- lib/cmdopt.rb
Instance Method Summary collapse
- #action(&block) ⇒ Object
- #get_item ⇒ Object
-
#initialize(item) ⇒ Builder
constructor
A new instance of Builder.
- #validation(&block) ⇒ Object
Constructor Details
#initialize(item) ⇒ Builder
Returns a new instance of Builder.
100 101 102 |
# File 'lib/cmdopt.rb', line 100 def initialize(item) @item = item end |
Instance Method Details
#action(&block) ⇒ Object
113 114 115 116 |
# File 'lib/cmdopt.rb', line 113 def action(&block) @item.handler = block self end |
#get_item ⇒ Object
104 105 106 |
# File 'lib/cmdopt.rb', line 104 def get_item return @item end |
#validation(&block) ⇒ Object
108 109 110 111 |
# File 'lib/cmdopt.rb', line 108 def validation(&block) @item.validator = block self end |