Class: RubyPocket::FavoriteQuery

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
TagsQueryHelper
Defined in:
lib/ruby_pocket/favorite_query.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope = nil) ⇒ FavoriteQuery

Returns a new instance of FavoriteQuery.



15
16
17
# File 'lib/ruby_pocket/favorite_query.rb', line 15

def initialize(scope = nil)
  @scope = scope || Favorite
end

Class Method Details

.where(options) ⇒ Object



9
10
11
# File 'lib/ruby_pocket/favorite_query.rb', line 9

def self.where(options)
  new.where(options)
end

Instance Method Details

#where(options) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/ruby_pocket/favorite_query.rb', line 19

def where(options)
  if options[:tag_names]
    tags = find_all_tags(options[:tag_names])
    @scope = where_tags(tags)
  end

  self
end