Class: Hamlize::CLI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = []) ⇒ CLI

Returns a new instance of CLI.



5
6
7
8
# File 'lib/hamlize/cli.rb', line 5

def initialize(args=[])
  @args    = args
  @options = default_options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/hamlize/cli.rb', line 3

def options
  @options
end

Instance Method Details

#start!Object



10
11
12
13
# File 'lib/hamlize/cli.rb', line 10

def start!
  OptionParser.new(&method(:set_opts)).parse!(@args)
  @options[:auto] ? auto! : default!
end