Class: Glark::Option

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/glark/util/option.rb

Direct Known Subclasses

RegexpOption, SizeLimitOption

Instance Method Summary collapse

Constructor Details

#initialize(optee) ⇒ Option

Returns a new instance of Option.



9
10
11
# File 'lib/glark/util/option.rb', line 9

def initialize optee
  @optee = optee
end

Instance Method Details

#add_to_option_data(optdata) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/glark/util/option.rb', line 26

def add_to_option_data optdata
  optdata << {
    :tags => tags,
    :arg  => [ argtype ],
    :set  => Proc.new { |pat| set pat }
  }
end

#match_rc(name, values) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/glark/util/option.rb', line 17

def match_rc name, values
  if name == rcfield
    values.each do |val|
      set val
    end
    true
  end
end

#tagsObject



13
14
15
# File 'lib/glark/util/option.rb', line 13

def tags
  [ '--' + rcfield ]
end