Class: Rudachi::Option::BooleanOption
- Inherits:
-
Delegator
- Object
- Delegator
- Rudachi::Option::BooleanOption
- Defined in:
- lib/rudachi/option/boolean_option.rb
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #enable? ⇒ Boolean
-
#initialize(bool) ⇒ BooleanOption
constructor
A new instance of BooleanOption.
- #with_arg? ⇒ Boolean
Constructor Details
#initialize(bool) ⇒ BooleanOption
Returns a new instance of BooleanOption.
4 5 6 7 |
# File 'lib/rudachi/option/boolean_option.rb', line 4 def initialize(bool) raise ArgumentError, 'must be `false` or `true`' unless bool.is_a?(FalseClass) || bool.is_a?(TrueClass) @value = bool end |
Instance Method Details
#__getobj__ ⇒ Object
9 |
# File 'lib/rudachi/option/boolean_option.rb', line 9 def __getobj__; @value; end |
#enable? ⇒ Boolean
10 |
# File 'lib/rudachi/option/boolean_option.rb', line 10 def enable? ; @value; end |
#with_arg? ⇒ Boolean
11 |
# File 'lib/rudachi/option/boolean_option.rb', line 11 def with_arg? ; false ; end |