Class: MixCloud::Tag
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- MixCloud::Tag
- Includes:
- HTTParty
- Defined in:
- lib/mixcloud/tag.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
writeonly
Sets the attribute options.
Instance Method Summary collapse
-
#initialize(tag_name, options = {}) ⇒ Tag
constructor
A new instance of Tag.
- #popular(options = nil) ⇒ Object
Constructor Details
#initialize(tag_name, options = {}) ⇒ Tag
Returns a new instance of Tag.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/mixcloud/tag.rb', line 21 def initialize(tag_name, ={}) @options = @tag = self.class.get("/tag/#{tag_name}", :query => @options) @tag['metadata']['connections'].each do |k,v| @tag['metadata'][k.to_sym] = v end @tag['metadata'].delete('connections') super @tag end |
Instance Attribute Details
#options=(value) ⇒ Object (writeonly)
Sets the attribute options
8 9 10 |
# File 'lib/mixcloud/tag.rb', line 8 def (value) @options = value end |
Instance Method Details
#popular(options = nil) ⇒ Object
33 34 35 36 |
# File 'lib/mixcloud/tag.rb', line 33 def popular(=nil) = ||= @options self.popular = self.class.get("#{self[:key]}popular/", :query => ) end |