Class: Vinery::API
Overview
Instance Method Summary collapse
-
#initialize(username, password) ⇒ API
constructor
Public: Initializes a new Vine API instance.
-
#tagged(tag, query = {}) ⇒ Object
Public: fetches a list of Vines that are tagged with a certain tag.
Constructor Details
#initialize(username, password) ⇒ API
26 27 28 |
# File 'lib/vinery/api.rb', line 26 def initialize(username, password) login(username, password) end |
Instance Method Details
#tagged(tag, query = {}) ⇒ Object
Public: fetches a list of Vines that are tagged with a certain tag.
tag - The String tag to search for. query - The Hash options used to refine the selection (default: {}).
:page - The Integer page number to paginate results (default: 1).
:size - The Integer number of results to display (default: 20).
Examples
vinery.tagged("funny")
vinery.tagged("funny", { page: 2, size: 10 })
Returns a Hash of Vines.
44 45 46 47 48 49 50 51 |
# File 'lib/vinery/api.rb', line 44 def tagged(tag, query = {}) query = { page: 1, size: 20 }.merge!(query) Collection.new(get_parsed("/timelines/tags/#{tag}", query)["records"].map { |r| Record.new(r) }) end |