Class: Corkboard::Publishers::Pusher
- Inherits:
-
Object
- Object
- Corkboard::Publishers::Pusher
- Defined in:
- lib/corkboard/publishers/pusher.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
Instance Method Summary collapse
-
#initialize(credentials) ⇒ Pusher
constructor
A new instance of Pusher.
-
#publish!(entry) ⇒ Object
Constructor Details
#initialize(credentials) ⇒ Pusher
Returns a new instance of Pusher.
8 9 10 11 |
# File 'lib/corkboard/publishers/pusher.rb', line 8 def initialize(credentials) @credentials = credentials configure end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
6 7 8 |
# File 'lib/corkboard/publishers/pusher.rb', line 6 def credentials @credentials end |
Instance Method Details
#publish!(entry) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/corkboard/publishers/pusher.rb', line 13 def publish!(entry) ::Pusher['corkboard'].trigger!('posts/new', { :eid => entry.eid, :image => entry.images.low_resolution.url, :caption => (entry. ? entry..text : ''), :tags => entry. }) end |