Class: Pincerna::Map
Overview
Shows addresses or coordinates on Google Maps.
Constant Summary collapse
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
-
#perform_filtering(query) ⇒ Array
Filters a query.
-
#process_results(results) ⇒ Array
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
#perform_filtering(query) ⇒ Array
Filters a query.
17 18 19 |
# File 'lib/pincerna/map.rb', line 17 def perform_filtering(query) {query: query} end |
#process_results(results) ⇒ Array
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 |