Class: MessageQuickly::Messaging::LocationAttachment

Inherits:
Attachment
  • Object
show all
Defined in:
lib/message_quickly/messaging/location_attachment.rb

Instance Attribute Summary collapse

Attributes inherited from Attachment

#payload, #type

Instance Method Summary collapse

Methods inherited from Attachment

#file?

Constructor Details

#initialize(params = {}) ⇒ LocationAttachment

Returns a new instance of LocationAttachment.



7
8
9
10
# File 'lib/message_quickly/messaging/location_attachment.rb', line 7

def initialize(params = {})
  params['type'] ||= 'location'
  super(params)
end

Instance Attribute Details

#latitudeObject

Returns the value of attribute latitude.



5
6
7
# File 'lib/message_quickly/messaging/location_attachment.rb', line 5

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



5
6
7
# File 'lib/message_quickly/messaging/location_attachment.rb', line 5

def longitude
  @longitude
end

Instance Method Details

#to_hashObject



12
13
14
# File 'lib/message_quickly/messaging/location_attachment.rb', line 12

def to_hash
  { type: type, payload: { coordinates: { lat: latitude, long: longitude } } }
end