Class: Flickrage::Service::Search
- Inherits:
-
Object
- Object
- Flickrage::Service::Search
- Includes:
- Helpers::Log
- Defined in:
- lib/flickrage/service/search.rb
Instance Attribute Summary collapse
-
#tagged_search ⇒ Object
readonly
Returns the value of attribute tagged_search.
Instance Method Summary collapse
-
#initialize ⇒ Search
constructor
A new instance of Search.
- #run(keyword) ⇒ Object
Methods included from Helpers::Log
Constructor Details
#initialize ⇒ Search
Returns a new instance of Search.
9 10 11 |
# File 'lib/flickrage/service/search.rb', line 9 def initialize @tagged_search = Flickrage.config.tagged_search end |
Instance Attribute Details
#tagged_search ⇒ Object (readonly)
Returns the value of attribute tagged_search.
7 8 9 |
# File 'lib/flickrage/service/search.rb', line 7 def tagged_search @tagged_search end |
Instance Method Details
#run(keyword) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/flickrage/service/search.rb', line 13 def run(keyword) result = search(keyword) return if result.size < 1 image(result.first, keyword) rescue StandardError => e logger.debug(e) nil end |