Class: EventMachine::Kannel::Client
- Inherits:
-
Object
- Object
- EventMachine::Kannel::Client
- Defined in:
- lib/em-kannel/client.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
- #deliver(&block) ⇒ Object
-
#initialize(message, configuration) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(message, configuration) ⇒ Client
Returns a new instance of Client.
6 7 8 9 |
# File 'lib/em-kannel/client.rb', line 6 def initialize(, configuration) self. = self.configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
4 5 6 |
# File 'lib/em-kannel/client.rb', line 4 def configuration @configuration end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/em-kannel/client.rb', line 4 def @message end |
Instance Method Details
#deliver(&block) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/em-kannel/client.rb', line 11 def deliver(&block) start = Time.now.to_f http = EM::HttpRequest.new(configuration.url, ).get(query: query) http.callback { callback(http, start, , &block) } http.errback { callback(http, start, , &block) } end |