Class: WaitFor::Settings::LegacyParser

Inherits:
Object
  • Object
show all
Defined in:
lib/waitfor/settings/legacy_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
27
28
29
# File 'lib/waitfor/settings/legacy_parser.rb', line 24

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

  # Default exception since legacy does not support specifying an exception.
  @config.exception = WaitFor::TimeoutError
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



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

def config
  @config
end

#paramsObject

Returns the value of attribute params.



6
7
8
# File 'lib/waitfor/settings/legacy_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/legacy_parser.rb', line 13

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

Instance Method Details

#parseObject

Call all parsing methods in order.



32
33
34
# File 'lib/waitfor/settings/legacy_parser.rb', line 32

def parse
  parse_time
end