Class: Dovado::Router::Sms::Messages
- Inherits:
-
Object
- Object
- Dovado::Router::Sms::Messages
- Includes:
- Celluloid
- Defined in:
- lib/dovado/router/sms/messages.rb
Overview
Text messages.
Instance Method Summary collapse
- #[](id) ⇒ Object
-
#add_message(message) ⇒ Object
Add a message to the local cache.
-
#get_message(id) ⇒ Message
Fetch a Message from the cache.
- #ids ⇒ Object
-
#initialize ⇒ Messages
constructor
Create a new Messages object.
Constructor Details
#initialize ⇒ Messages
Create a new Dovado::Router::Sms::Messages object.
13 14 15 |
# File 'lib/dovado/router/sms/messages.rb', line 13 def initialize @messages = ThreadSafe::Cache.new end |
Instance Method Details
#[](id) ⇒ Object
32 33 34 |
# File 'lib/dovado/router/sms/messages.rb', line 32 def [](id) (id) end |
#add_message(message) ⇒ Object
Add a message to the local cache.
19 20 21 |
# File 'lib/dovado/router/sms/messages.rb', line 19 def () @messages[.id] = unless .nil? end |
#get_message(id) ⇒ Message
Fetch a Dovado::Router::Sms::Message from the cache.
28 29 30 |
# File 'lib/dovado/router/sms/messages.rb', line 28 def (id) @messages[id] unless id.nil? end |
#ids ⇒ Object
36 37 38 |
# File 'lib/dovado/router/sms/messages.rb', line 36 def ids @messages.keys end |