Class: Haller

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

Defined Under Namespace

Classes: HallApiError

Constant Summary collapse

ROOT_URI =
'https://hall.com'
ENDPOINT =
'/api/1/services/generic/'
OPTION_DEFAULTS =
{
sender_title: 'Haller',
sender_icon_url: nil}
CAPISTRANO_THUMB_URL =
'https://raw.github.com/smashingboxes/capistrano-haller/master/resources/capistrano-logo.png'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(room_key, options = {}) ⇒ Haller

Returns a new instance of Haller.



16
17
18
19
# File 'lib/haller.rb', line 16

def initialize(room_key, options = {})
  @options = OPTION_DEFAULTS.merge(options)
  @room_key = room_key
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



14
15
16
# File 'lib/haller.rb', line 14

def options
  @options
end

#room_keyObject

Returns the value of attribute room_key.



13
14
15
# File 'lib/haller.rb', line 13

def room_key
  @room_key
end

Instance Method Details

#send_message(message) ⇒ Object



21
22
23
# File 'lib/haller.rb', line 21

def send_message(message)
  post(message_json(message))
end