Class: MixCloud::Tag

Inherits:
Hashie::Dash
  • Object
show all
Includes:
HTTParty
Defined in:
lib/mixcloud/tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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={})
  @options = 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

Parameters:

  • value

    the value to set the attribute options to.



8
9
10
# File 'lib/mixcloud/tag.rb', line 8

def options=(value)
  @options = value
end

Instance Method Details



33
34
35
36
# File 'lib/mixcloud/tag.rb', line 33

def popular(options=nil)      
  options = options ||= @options            
  self.popular = self.class.get("#{self[:key]}popular/", :query => options)
end