Class: Wassup::Panes::Shortcut::Stories
- Inherits:
-
Object
- Object
- Wassup::Panes::Shortcut::Stories
- Defined in:
- lib/wassup/panes/shortcut.rb
Instance Attribute Summary collapse
-
#query_pages ⇒ Object
Returns the value of attribute query_pages.
Instance Method Summary collapse
- #configure(pane) ⇒ Object
-
#initialize(query: nil, query_pages: nil) ⇒ Stories
constructor
A new instance of Stories.
Constructor Details
#initialize(query: nil, query_pages: nil) ⇒ Stories
Returns a new instance of Stories.
7 8 9 10 |
# File 'lib/wassup/panes/shortcut.rb', line 7 def initialize(query: nil, query_pages: nil) @query_pages = query_pages @query_pages ||= { "": query } if query end |
Instance Attribute Details
#query_pages ⇒ Object
Returns the value of attribute query_pages.
5 6 7 |
# File 'lib/wassup/panes/shortcut.rb', line 5 def query_pages @query_pages end |
Instance Method Details
#configure(pane) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/wassup/panes/shortcut.rb', line 12 def configure(pane) pane.content do |content| query_pages.each do |k,v| stories = Helpers::Shortcut.search_stories(query: v) stories.each do |story| display = Helpers::Shortcut::Formatter.story(story) content.add_row(display, story, page: k.to_s) end end end pane.selection('enter', 'Open in Shortcut') do |story| url = story['app_url'] `open #{url}` end end |