Class: Rudachi::Option::StringOption

Inherits:
Delegator
  • Object
show all
Defined in:
lib/rudachi/option/string_option.rb

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ StringOption

Returns a new instance of StringOption.

Raises:

  • (ArgumentError)


4
5
6
7
# File 'lib/rudachi/option/string_option.rb', line 4

def initialize(str)
  raise ArgumentError, 'must be `nil` or `String`' unless str.nil? || str.is_a?(String)
  @value = str
end

Instance Method Details

#__getobj__Object



9
# File 'lib/rudachi/option/string_option.rb', line 9

def __getobj__; @value  ; end

#enable?Boolean

Returns:

  • (Boolean)


10
# File 'lib/rudachi/option/string_option.rb', line 10

def enable?   ; !!@value; end

#with_arg?Boolean

Returns:

  • (Boolean)


11
# File 'lib/rudachi/option/string_option.rb', line 11

def with_arg? ; true    ; end