Class: NicoQuery::Object::TagSearch
- Inherits:
-
Object
- Object
- NicoQuery::Object::TagSearch
- Defined in:
- lib/nicoquery/object/tag_search.rb
Instance Attribute Summary collapse
-
#movies ⇒ Object
Returns the value of attribute movies.
Instance Method Summary collapse
-
#initialize(tag: tag, sort: sort, order: order, page: page) ⇒ TagSearch
constructor
A new instance of TagSearch.
Constructor Details
#initialize(tag: tag, sort: sort, order: order, page: page) ⇒ TagSearch
Returns a new instance of TagSearch.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/nicoquery/object/tag_search.rb', line 23 def initialize(tag: tag, sort: sort, order: order, page: page) @movies = [] response = (NicoQuery::Api::TagSearchRss.new(tag: tag, sort: sort, order: order, page: page)).get @hash = NicoQuery::ObjectMapper::TagSearchRss.new response[:body] @hash.items.map do |item| movie = NicoQuery::Object::Movie.new item.video_id movie.set_tag_search_rss_source item @movies.push movie end end |
Instance Attribute Details
#movies ⇒ Object
Returns the value of attribute movies.
10 11 12 |
# File 'lib/nicoquery/object/tag_search.rb', line 10 def movies @movies end |