Class: Flickr::Tag

Inherits:
Base
  • Object
show all
Defined in:
lib/flickr-wrapper/tag.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#user_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#machine_tags, #photos, #sets, #tags

Constructor Details

#initialize(tag) ⇒ Tag

Returns a new instance of Tag.



4
5
6
# File 'lib/flickr-wrapper/tag.rb', line 4

def initialize(tag)
  @value = tag
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



2
3
4
# File 'lib/flickr-wrapper/tag.rb', line 2

def value
  @value
end

Class Method Details

.list(user_id) ⇒ Object



8
9
10
11
12
# File 'lib/flickr-wrapper/tag.rb', line 8

def self.list(user_id)
  (Flickr::Query.new(user_id).execute('flickr.tags.getListUser')/:tag).map { |tag| 
    self.new(tag.inner_text.to_s) if tag.inner_text.to_s =~ /^([a-zA-Z0-9_-]+)$/
  }.compact
end