Class: NewsFetcher::Commands::Show
- Inherits:
-
NewsFetcher::Command
- Object
- Simple::CommandParser::Command
- NewsFetcher::Command
- NewsFetcher::Commands::Show
- Defined in:
- lib/newsfetcher/commands/show.rb
Instance Attribute Summary collapse
-
#sort ⇒ Object
Returns the value of attribute sort.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from NewsFetcher::Command
#dir, #log_level, #max_threads
Instance Method Summary collapse
Instance Attribute Details
#sort ⇒ Object
Returns the value of attribute sort.
8 9 10 |
# File 'lib/newsfetcher/commands/show.rb', line 8 def sort @sort end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/newsfetcher/commands/show.rb', line 7 def status @status end |
Instance Method Details
#run(args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/newsfetcher/commands/show.rb', line 10 def run(args) super @profile.find_subscriptions( ids: args, status: @status&.split(',')&.map(&:to_sym), sort: @sort&.to_sym, ).each do |subscription| subscription.print puts end end |