Class: Emailbutler::DSL
- Inherits:
-
Object
- Object
- Emailbutler::DSL
- Defined in:
- lib/emailbutler/dsl.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
Instance Method Summary collapse
-
#build_message(args = {}) ⇒ Object
Public: Build a message.
-
#count_messages_by_status ⇒ Object
Public: Groups messages by status and count them.
-
#destroy_message(message) ⇒ Object
Public: Destroys the message.
-
#find_message_by(args = {}) ⇒ Object
Public: Finds message by args.
-
#find_messages_by(args = {}) ⇒ Object
Public: Finds messages by args.
-
#initialize(adapter) ⇒ DSL
constructor
Public: Returns a new instance of the DSL.
-
#resend_message(message) ⇒ Object
Public: Resends the message.
-
#save_message(message) ⇒ Object
Public: Saves the message.
-
#set_message_attribute(*args) ⇒ Object
Public: Sets attribute with value for the message.
-
#update_message(message, args = {}) ⇒ Object
Public: Updates the message.
Constructor Details
#initialize(adapter) ⇒ DSL
Public: Returns a new instance of the DSL.
adapter - The adapter that this DSL instance should use.
10 11 12 |
# File 'lib/emailbutler/dsl.rb', line 10 def initialize(adapter) @adapter = adapter end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
5 6 7 |
# File 'lib/emailbutler/dsl.rb', line 5 def adapter @adapter end |
Instance Method Details
#build_message(args = {}) ⇒ Object
Public: Build a message.
15 16 17 |
# File 'lib/emailbutler/dsl.rb', line 15 def (args={}) adapter.(args) end |
#count_messages_by_status ⇒ Object
Public: Groups messages by status and count them.
40 41 42 |
# File 'lib/emailbutler/dsl.rb', line 40 def adapter. end |
#destroy_message(message) ⇒ Object
Public: Destroys the message.
55 56 57 |
# File 'lib/emailbutler/dsl.rb', line 55 def () adapter.() end |
#find_message_by(args = {}) ⇒ Object
Public: Finds message by args.
30 31 32 |
# File 'lib/emailbutler/dsl.rb', line 30 def (args={}) adapter.(args) end |
#find_messages_by(args = {}) ⇒ Object
Public: Finds messages by args.
45 46 47 |
# File 'lib/emailbutler/dsl.rb', line 45 def (args={}) adapter.(args) end |
#resend_message(message) ⇒ Object
Public: Resends the message.
50 51 52 |
# File 'lib/emailbutler/dsl.rb', line 50 def () adapter.() end |
#save_message(message) ⇒ Object
Public: Saves the message.
25 26 27 |
# File 'lib/emailbutler/dsl.rb', line 25 def () adapter.() end |
#set_message_attribute(*args) ⇒ Object
Public: Sets attribute with value for the message.
20 21 22 |
# File 'lib/emailbutler/dsl.rb', line 20 def (*args) adapter.(*args) end |
#update_message(message, args = {}) ⇒ Object
Public: Updates the message.
35 36 37 |
# File 'lib/emailbutler/dsl.rb', line 35 def (, args={}) adapter.(, args) end |