Class: WaitFor::Settings::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/waitfor/settings/parser.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, config) ⇒ Configuration

Create a new Parser.

Parameters:

  • params (Fixnum)

    parameters

  • config (Configuration)

    new Configuration object to populate with options



24
25
26
# File 'lib/waitfor/settings/parser.rb', line 24

def initialize( params, config )
  @params, @config = params, config
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



6
7
8
# File 'lib/waitfor/settings/parser.rb', line 6

def config
  @config
end

#paramsObject

Returns the value of attribute params.



6
7
8
# File 'lib/waitfor/settings/parser.rb', line 6

def params
  @params
end

Class Method Details

.parse(params, config) ⇒ Configuration

Parse parameters and return Configuration object.

Parameters:

  • params (Fixnum)

    parameters

  • config (Configuration)

    new Configuration object to populate with options

Returns:



13
14
15
16
17
# File 'lib/waitfor/settings/parser.rb', line 13

def self.parse( params, config )
  parser = WaitFor::Settings::Parser.new( params, config )
  parser.parse
  parser.config
end

Instance Method Details

#parseObject

Call all parsing methods in order.



29
30
31
32
33
34
# File 'lib/waitfor/settings/parser.rb', line 29

def parse
  parse_seconds
  parse_minutes
  parse_exception
  parse_message
end