Class: Kosi::CharOption

Inherits:
Object
  • Object
show all
Defined in:
lib/kosi/char_option.rb

Overview

CharOption

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CharOption

Returns a new instance of CharOption.



10
11
12
13
14
15
16
# File 'lib/kosi/char_option.rb', line 10

def initialize(options)
  @value = String(options[key])
  @value = default if @value.empty?
  unless @value.size == 1
    fail ArgumentError, format(invalid_char_msg, @value.size, @value)
  end
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8
9
10
# File 'lib/kosi/char_option.rb', line 8

def value
  @value
end