Class: Pincerna::Map
Overview
Shows addresses or coordinates on Google Maps.
Constant Summary
- ICON =
The icon to show for each feedback item.
Pincerna::Base::ROOT + "/images/map.png"
Constants inherited from Base
Base::CACHE_ROOT, Base::FULL_NAME, Base::MATCHER, Base::RELEVANT_MATCHES, Base::ROOT, Base::TYPES, Base::WORKFLOW_ROOT
Instance Attribute Summary
Attributes inherited from Base
#format, #format_content_type, #output
Instance Method Summary (collapse)
-
- (Array) perform_filtering(query)
Filters a query.
-
- (Array) process_results(results)
Processes items to obtain feedback items.
Methods inherited from Base
#add_feedback_item, execute!, #filter, #format_float, #initialize, #output_feedback, #round_float
Constructor Details
This class inherits a constructor from Pincerna::Base
Instance Method Details
- (Array) perform_filtering(query)
Filters a query.
17 18 19 |
# File 'lib/pincerna/map.rb', line 17 def perform_filtering(query) {query: query} end |
- (Array) process_results(results)
Processes items to obtain feedback items.
25 26 27 28 |
# File 'lib/pincerna/map.rb', line 25 def process_results(results) type = results[:query] =~ /((-?)\d+(\.\d+)?)\s*,\s*((-?)\d+(\.\d+)?)/ ? "coordinates" : "location" [{title: "View #{type} on Google Maps", arg: CGI.escape(results[:query]), subtitle: "Action this item to open Google Maps in the browser.", icon: ICON}] end |