Class: Flickr::MachineTag
- Includes:
- Validatable
- Defined in:
- lib/flickr-wrapper/machine_tag.rb
Overview
:nodoc
Defined Under Namespace
Classes: Invalid
Instance Attribute Summary collapse
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#predicate ⇒ Object
Returns the value of attribute predicate.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(namespace, predicate, value) ⇒ MachineTag
constructor
A new instance of MachineTag.
- #to_s ⇒ Object
Methods inherited from Base
#machine_tags, #photos, #sets, #tags
Constructor Details
#initialize(namespace, predicate, value) ⇒ MachineTag
Returns a new instance of MachineTag.
9 10 11 |
# File 'lib/flickr-wrapper/machine_tag.rb', line 9 def initialize(namespace, predicate, value) @namespace, @predicate, @value = namespace, predicate, value end |
Instance Attribute Details
#namespace ⇒ Object
Returns the value of attribute namespace.
7 8 9 |
# File 'lib/flickr-wrapper/machine_tag.rb', line 7 def namespace @namespace end |
#predicate ⇒ Object
Returns the value of attribute predicate.
7 8 9 |
# File 'lib/flickr-wrapper/machine_tag.rb', line 7 def predicate @predicate end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/flickr-wrapper/machine_tag.rb', line 7 def value @value end |
Class Method Details
.from_s(string) ⇒ Object
17 18 19 |
# File 'lib/flickr-wrapper/machine_tag.rb', line 17 def self.from_s(string) new($1, $2, $3) if string =~ /(.*)\:(.*)\=(.*)/ end |
.list(user_id) ⇒ Object
13 14 15 |
# File 'lib/flickr-wrapper/machine_tag.rb', line 13 def self.list(user_id) (Flickr::Query.new(user_id).execute('flickr.tags.getListUser')/:tag).parallel_map(Flickr::MAX_THREADS) {|tag| self.from_s tag.inner_text.to_s }.compact end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/flickr-wrapper/machine_tag.rb', line 21 def to_s "#{namespace}:#{predicate}=#{value}" end |