Class: Airbrush::Server
Instance Attribute Summary collapse
-
#listener ⇒ Object
readonly
Returns the value of attribute listener.
Instance Method Summary collapse
-
#initialize(context = {}) ⇒ Server
constructor
A new instance of Server.
- #start ⇒ Object
Constructor Details
#initialize(context = {}) ⇒ Server
Returns a new instance of Server.
5 6 7 8 9 10 11 12 13 |
# File 'lib/airbrush/server.rb', line 5 def initialize(context = {}) memcache_host = context[:memcache] memcache_poll = context[:frequency] Object.send :__create_logger__, context[:log_target] if context.include? :log_target log.level = context[:verbose] ? ActiveSupport::BufferedLogger::Severity::DEBUG : ActiveSupport::BufferedLogger::Severity::INFO @listener = Airbrush::Listeners::Memcache.new(memcache_host, memcache_poll) @listener.handler = Handler.new(Processors::Image::Rmagick.new, Publishers::Memcache.new(memcache_host)) end |
Instance Attribute Details
#listener ⇒ Object (readonly)
Returns the value of attribute listener.
3 4 5 |
# File 'lib/airbrush/server.rb', line 3 def listener @listener end |
Instance Method Details
#start ⇒ Object
15 16 17 |
# File 'lib/airbrush/server.rb', line 15 def start @listener.start end |