Permalink
Browse files

switching documentation from rdoc to yard

  • Loading branch information...
1 parent 32418cc commit bf818ab29ae41da9b5196137298591cc1b3feee9 filip committed Feb 13, 2011
Showing with 35 additions and 17 deletions.
  1. +1 −0 7digital.gemspec
  2. +25 −17 lib/sevendigital/management/artist_manager.rb
  3. +1 −0 lib/sevendigital/management/manager.rb
  4. +8 −0 yard_extensions.rb
View
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ["README.rdoc"]
s.add_dependency('peachy', '>= 0.3.5')
s.add_dependency('will_paginate', '>= 2.3.15')
+ s.add_development_dependency('yard', '>= 0.6.0')
s.homepage = "http://github.com/filip7d/7digital"
s.rdoc_options = ["--main", "README.rdoc"]
s.rubygems_version = "1.3.6"
@@ -7,79 +7,87 @@ class ArtistManager < Manager
# calls *artist/details* API method and returns Artist with populated details
#
- # <tt>artist_id</tt>:: artist ID
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [Integer] artist_id
+ # @param [Hash] options optional hash of additional API parameters, e.g. page_size => 50, etc
+ # @return [Artist]
def get_details(artist_id, options={})
api_response = @api_client.make_api_request("artist/details", {:artistId => artist_id}, options)
@api_client.artist_digestor.from_xml(api_response.content.artist)
end
# calls *artist/releases* API method and returns Release array
#
- # <tt>artist_id</tt>:: artist ID
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [Integer] artist_id
+ # @param [Hash] options optional hash of additional API parameters, e.g. \{page_size => 50\}, etc
+ # @return [[Artist]]
def get_releases(artist_id, options={})
api_response = @api_client.make_api_request("artist/releases", {:artistId => artist_id}, options)
@api_client.release_digestor.list_from_xml(api_response.content.releases)
end
# calls *artist/toptracks* API method and returns Track array
#
- # <tt>artist_id</tt>:: artist ID
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [Integer] artist_id
+ # @param [Hash] options optional hash of additional API parameters, e.g. \{page_size => 50\}, etc
+ # @return [Array<Track>]
def get_top_tracks(artist_id, options={})
api_response = @api_client.make_api_request("artist/topTracks", {:artistId => artist_id}, options)
@api_client.track_digestor.list_from_xml(api_response.content.tracks)
end
# calls *artist/similar* API method and returns Artist array
#
- # <tt>artist_id</tt>:: artist ID
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [Integer] artist_id
+ # @param [Hash] options optional hash of additional API parameters, e.g. \{page_size => 50\}, etc
+ # @return [Array<Artist>]
def get_similar(artist_id, options={})
api_response = @api_client.make_api_request("artist/similar", {:artistId => artist_id}, options)
@api_client.artist_digestor.list_from_xml(api_response.content.artists)
end
# calls *artist/byTag/top* API method and returns Artist array
#
- # <tt>tags</tt>:: string containing comma separated list of tags
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [String] tags tag or comma separated list of tags
+ # @param [Hash] options optional hash of additional API parameters, e.g. \{page_size => 50\}, etc
+ # @return [Array<Artist>]
def get_top_by_tag(tags, options={})
api_response = @api_client.make_api_request("artist/byTag/top", {:tags => tags}, options)
@api_client.artist_digestor.nested_list_from_xml(api_response.content.tagged_results, :tagged_item, :tagged_results)
end
# calls *artist/search* API method and returns Artist array
#
- # <tt>query</tt>:: string containing the search query
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [String] query search query
+ # @param [Hash] options optional hash of additional API parameters, e.g. \{page_size => 50\}, etc
+ # @return [Array<Artist>]
def search(query, options={})
api_response = @api_client.make_api_request("artist/search", {:q => query}, options)
@api_client.artist_digestor.nested_list_from_xml(api_response.content.search_results, :search_result, :search_results)
end
# calls *artist/browse* API method and returns Artist array
#
- # <tt>letter</tt>:: string containing the search query
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [String] letter the letter(s) returned artist names should artists
+ # @param [Hash] options optional hash of additional API parameters, e.g. \{page_size => 50\}, etc
+ # @return [Array<Artist>]
def browse(letter, options={})
api_response = @api_client.make_api_request("artist/browse", {:letter => letter}, options)
@api_client.artist_digestor.list_from_xml(api_response.content.artists)
end
# calls *artist/chart* API method and returns Artist array
#
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [Hash] options optional hash of additional API parameters, e.g. \{page_size => 50\}, etc
def get_chart(options={})
api_response = @api_client.make_api_request("artist/chart", {}, options)
@api_client.chart_item_digestor.list_from_xml(api_response.content.chart)
end
# calls *artist/tags* API method and returns Tag array
#
- # <tt>artist_id</tt>:: artist ID
- # <tt>options</tt>:: optional hash of additional API parameters, e.g. {page_size => 50}, etc
+ # @param [Integer] artist_id
+ # @param [Hash] options optional hash of additional API parameters, e.g. \{page_size => 50\}, etc
+ # @return [Array<Tag>]
def get_tags(artist_id, options={})
api_response = @api_client.make_api_request("artist/tags", {:artistId => artist_id}, options)
@api_client.tag_digestor.list_from_xml(api_response.content.tags)
@@ -1,5 +1,6 @@
module Sevendigital
+ #@private
class Manager # :nodoc:
def initialize(api_client)
View
@@ -0,0 +1,8 @@
+class ClassAttributeHandler < YARD::Handlers::Ruby::AttributeHandler
+ handles method_call(:sevendigital_basic_property)
+ handles method_call(:sevendigital_extended_property)
+
+ def process
+ super
+ end
+end

0 comments on commit bf818ab

Please sign in to comment.