Module: Doubapi
- Defined in:
- lib/doubapi.rb,
lib/doubapi/version.rb
Defined Under Namespace
Classes: Album, Douban, Event, Track
Constant Summary collapse
- VERSION =
"0.1.6"
Class Method Summary collapse
-
.search_albums_of(h, &block) ⇒ Object
input :singer,:since return total number of events satisfying the search criterion return Doubapi::Album[].
-
.search_events_of(h, &block) ⇒ Object
input:=> “all/singer_name”, :location => “shanghai”, :start_index => 16,:max_result => 15 return total number of events satisfying the search criterion Doubapi::Event[].
Class Method Details
.search_albums_of(h, &block) ⇒ Object
input :singer,:since return total number of events satisfying the search criterion return Doubapi::Album[]
84 85 86 87 88 89 90 91 92 |
# File 'lib/doubapi.rb', line 84 def self.search_albums_of h ,&block totalResult, returnedResult = Douban.search_albums_of_v2 h if block_given? returnedResult.each {|album| block.call(album) } return totalResult; else return [totalResult, returnedResult] end end |
.search_events_of(h, &block) ⇒ Object
input:=> “all/singer_name”, :location => “shanghai”, :start_index => 16,:max_result => 15 return total number of events satisfying the search criterion Doubapi::Event[]
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/doubapi.rb', line 68 def self.search_events_of h ,&block totalResult, returnedResult = Douban.search_events_of h if block_given? returnedResult.each {|event| block.call(event) if block_given?} return totalResult; else return [totalResult, returnedResult] end end |