Class: Ownlan::Application
- Inherits:
-
Object
- Object
- Ownlan::Application
- Defined in:
- lib/ownlan/application.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#config_options ⇒ Object
readonly
Returns the value of attribute config_options.
-
#raw_options ⇒ Object
readonly
Returns the value of attribute raw_options.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options) ⇒ Application
constructor
A new instance of Application.
Constructor Details
#initialize(options) ⇒ Application
Returns a new instance of Application.
6 7 8 9 10 11 12 13 14 |
# File 'lib/ownlan/application.rb', line 6 def initialize() @raw_options = @config = ::Ownlan.config.dup @config_options = .reject{ |k, v| k.to_s.match('_given') || !v } end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/ownlan/application.rb', line 4 def config @config end |
#config_options ⇒ Object (readonly)
Returns the value of attribute config_options.
4 5 6 |
# File 'lib/ownlan/application.rb', line 4 def @config_options end |
#raw_options ⇒ Object (readonly)
Returns the value of attribute raw_options.
4 5 6 |
# File 'lib/ownlan/application.rb', line 4 def @raw_options end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/ownlan/application.rb', line 16 def call action = config.modes.find do |type, modes| modes.find { |mode| process(type, mode) } end unless action end |