Class: Wfrmls::CLI::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/wfrmls/cli/options.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Options

Returns a new instance of Options.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/wfrmls/cli/options.rb', line 13

def initialize(*args)
  argv = args.flatten

  opt = OptionParser.new do |opt|
    opt.banner = "Usage: #{script_name} [options] <address>"
    opt.version = version

    #opt.on("-r [PATH]", "Require [PATH] before executing") do |path|
    #  @paths_to_require << path
    #end

    opt.on("-c", "Comp this address") do
      @comp = true
    end

    opt.on("-o", "Check opposition's sale") do
      @opposition = true
    end

    opt.on("-h", "-?", "--help", "Show this message") do
      puts opt
      exit
    end

    opt.on("-v", "--version", "Show #{script_name}'s version (#{version})") do
     puts version
      exit
    end
  end

  opt.parse!(argv)
  @address = argv.dup.join(' ')
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



11
12
13
# File 'lib/wfrmls/cli/options.rb', line 11

def address
  @address
end

Instance Method Details

#comp?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/wfrmls/cli/options.rb', line 47

def comp?
  @comp
end

#opposition?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/wfrmls/cli/options.rb', line 51

def opposition?
  @opposition
end