Class: Airplay::Configuration
- Inherits:
-
Object
- Object
- Airplay::Configuration
- Defined in:
- lib/airplay/configuration.rb
Overview
Public: Handles the Airplay configuration
Instance Attribute Summary collapse
-
#autodiscover ⇒ Object
Returns the value of attribute autodiscover.
-
#host ⇒ Object
Returns the value of attribute host.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#output ⇒ Object
Returns the value of attribute output.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#load ⇒ Object
Public: Loads the configuration into the affected parts.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/airplay/configuration.rb', line 13 def initialize Celluloid.boot # Force Thread Pool initialization Log4r.define_levels(*Log4r::Log4rConfig::LogLevels) @log_level = Log4r::ERROR @autodiscover = true @host = "0.0.0.0" @port = nil @output = Log4r::Outputter.stdout end |
Instance Attribute Details
#autodiscover ⇒ Object
Returns the value of attribute autodiscover.
11 12 13 |
# File 'lib/airplay/configuration.rb', line 11 def autodiscover @autodiscover end |
#host ⇒ Object
Returns the value of attribute host.
11 12 13 |
# File 'lib/airplay/configuration.rb', line 11 def host @host end |
#log_level ⇒ Object
Returns the value of attribute log_level.
11 12 13 |
# File 'lib/airplay/configuration.rb', line 11 def log_level @log_level end |
#output ⇒ Object
Returns the value of attribute output.
11 12 13 |
# File 'lib/airplay/configuration.rb', line 11 def output @output end |
#port ⇒ Object
Returns the value of attribute port.
11 12 13 |
# File 'lib/airplay/configuration.rb', line 11 def port @port end |
Instance Method Details
#load ⇒ Object
Public: Loads the configuration into the affected parts
Returns nothing.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/airplay/configuration.rb', line 28 def load level = if @log_level.is_a?(Fixnum) @log_level else Log4r.const_get(@log_level.upcase) end Log4r::Logger.root.add @output Log4r::Logger.root.level = level Celluloid.logger = Airplay::Logger.new("airplay::celluloid") end |