Class: RubyPocket::FavoriteQuery

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
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.



13
14
15
# File 'lib/ruby_pocket/favorite_query.rb', line 13

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

Class Method Details

.where(options) ⇒ Object



7
8
9
# File 'lib/ruby_pocket/favorite_query.rb', line 7

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

Instance Method Details

#where(options) ⇒ Object



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

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

  self
end