Class: Broadcast::Message::Simple

Inherits:
Broadcast::Message show all
Defined in:
lib/broadcast/simple.rb

Instance Attribute Summary collapse

Attributes inherited from Broadcast::Message

#options

Instance Method Summary collapse

Methods inherited from Broadcast::Message

#initialize

Methods included from Publishable

included

Constructor Details

This class inherits a constructor from Broadcast::Message

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/broadcast/simple.rb', line 3

def body
  @body
end

#subjectObject

Returns the value of attribute subject.



3
4
5
# File 'lib/broadcast/simple.rb', line 3

def subject
  @subject
end

Instance Method Details

#publish(medium, medium_arguments = {}) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/broadcast/simple.rb', line 13

def publish(medium, medium_arguments = {})
  begin
    Broadcast::Medium.const_get(medium.to_s.downcase.capitalize).new(medium_arguments).publish(self)
  rescue
    Broadcast.logger.error "Publishing of #{self.class.name} to #{medium} failed:\n#{$!}"
  end
end