Class: IfreeSms::Manager
- Inherits:
-
Object
- Object
- IfreeSms::Manager
- Extended by:
- Callbacks
- Defined in:
- lib/ifree_sms/manager.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
-
#_run_callbacks(*args) ⇒ Object
:api: private.
-
#call(env) ⇒ Object
:nodoc:.
-
#initialize(app, options = {}) {|@config| ... } ⇒ Manager
constructor
Initialize the middleware.
Methods included from Callbacks
_incoming_message, incoming_message
Constructor Details
#initialize(app, options = {}) {|@config| ... } ⇒ Manager
Initialize the middleware. If a block is given, a IfreeSms::Config is yielded so you can properly configure the IfreeSms::Manager.
10 11 12 13 14 15 16 |
# File 'lib/ifree_sms/manager.rb', line 10 def initialize(app, ={}) .symbolize_keys! @app, @config = app, IfreeSms::Config.new() yield @config if block_given? self end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
6 7 8 |
# File 'lib/ifree_sms/manager.rb', line 6 def config @config end |
Instance Method Details
#_run_callbacks(*args) ⇒ Object
:api: private
27 28 29 |
# File 'lib/ifree_sms/manager.rb', line 27 def _run_callbacks(*args) #:nodoc: self.class._run_callbacks(*args) end |
#call(env) ⇒ Object
:nodoc:
18 19 20 21 22 23 24 |
# File 'lib/ifree_sms/manager.rb', line 18 def call(env) # :nodoc: if smsing_path?(env['PATH_INFO']) create(env) else @app.call(env) end end |