Class: Far::Options

Inherits:
Hash
  • Object
show all
Defined in:
lib/far/options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

#hmap

Constructor Details

#initialize(options = {}) ⇒ Options

Returns a new instance of Options.



9
10
11
12
13
# File 'lib/far/options.rb', line 9

def initialize(options={})
  options.each do |k, v|
    self[k.to_sym] = Option.new k, v
  end
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



3
4
5
# File 'lib/far/options.rb', line 3

def options
  @options
end

Class Method Details

.far_optionsObject



5
6
7
# File 'lib/far/options.rb', line 5

def self.far_options
  [:replace, :no_replace, :please, :no_please]
end

Instance Method Details

#to_command_lineObject



15
16
17
18
19
# File 'lib/far/options.rb', line 15

def to_command_line
  self.reject do |k, v|
    v.far_option?
  end.values.map(&:to_command_line).join(" ")
end