Class: MessageQuickly::Messaging::LocationAttachment
- Inherits:
-
Attachment
- Object
- Base
- Attachment
- MessageQuickly::Messaging::LocationAttachment
- Defined in:
- lib/message_quickly/messaging/location_attachment.rb
Instance Attribute Summary collapse
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
Attributes inherited from Attachment
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ LocationAttachment
constructor
A new instance of LocationAttachment.
- #to_hash ⇒ Object
Methods inherited from Attachment
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
#latitude ⇒ Object
Returns the value of attribute latitude.
5 6 7 |
# File 'lib/message_quickly/messaging/location_attachment.rb', line 5 def latitude @latitude end |
#longitude ⇒ Object
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_hash ⇒ Object
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 |