Class: Emailbutler::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/emailbutler/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#adapterObject (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 build_message(args={})
  adapter.build_message(args)
end

#count_messages_by_statusObject

Public: Groups messages by status and count them.



40
41
42
# File 'lib/emailbutler/dsl.rb', line 40

def count_messages_by_status
  adapter.count_messages_by_status
end

#destroy_message(message) ⇒ Object

Public: Destroys the message.



55
56
57
# File 'lib/emailbutler/dsl.rb', line 55

def destroy_message(message)
  adapter.destroy_message(message)
end

#find_message_by(args = {}) ⇒ Object

Public: Finds message by args.



30
31
32
# File 'lib/emailbutler/dsl.rb', line 30

def find_message_by(args={})
  adapter.find_message_by(args)
end

#find_messages_by(args = {}) ⇒ Object

Public: Finds messages by args.



45
46
47
# File 'lib/emailbutler/dsl.rb', line 45

def find_messages_by(args={})
  adapter.find_messages_by(args)
end

#resend_message(message) ⇒ Object

Public: Resends the message.



50
51
52
# File 'lib/emailbutler/dsl.rb', line 50

def resend_message(message)
  adapter.resend_message(message)
end

#save_message(message) ⇒ Object

Public: Saves the message.



25
26
27
# File 'lib/emailbutler/dsl.rb', line 25

def save_message(message)
  adapter.save_message(message)
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 set_message_attribute(*args)
  adapter.set_message_attribute(*args)
end

#update_message(message, args = {}) ⇒ Object

Public: Updates the message.



35
36
37
# File 'lib/emailbutler/dsl.rb', line 35

def update_message(message, args={})
  adapter.update_message(message, args)
end