Class: Line::Bot::Message::Location
- Inherits:
-
Base
- Object
- Base
- Line::Bot::Message::Location
show all
- Defined in:
- lib/line/bot/message/location.rb
Instance Attribute Summary
Attributes inherited from Base
#attrs
Instance Method Summary
collapse
Methods inherited from Base
#[], #event_type, #initialize
Instance Method Details
#content ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/line/bot/message/location.rb', line 8
def content
{
contentType: ContentType::LOCATION,
toType: 1,
text: attrs[:address] || attrs[:title],
location: {
title: attrs[:title],
address: attrs[:address],
latitude: attrs[:latitude],
longitude: attrs[:longitude],
}
}
end
|
#valid? ⇒ Boolean
22
23
24
|
# File 'lib/line/bot/message/location.rb', line 22
def valid?
attrs[:title] && attrs[:latitude] && attrs[:longitude]
end
|