Class: Net::Flickr::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/net/flickr/tag.rb

Overview

A Flickr photo tag.

Don’t instantiate this class yourself.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flickr, tag_xml) ⇒ Tag

Returns a new instance of Tag.



38
39
40
41
42
43
44
45
46
# File 'lib/net/flickr/tag.rb', line 38

def initialize(flickr, tag_xml)
  @flickr = flickr
  
  @id          = tag_xml['id']
  @author      = tag_xml['author']
  @raw         = tag_xml['raw']
  @name        = tag_xml.inner_text
  @machine_tag = tax_xml['machine_tag'] == '1'
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



36
37
38
# File 'lib/net/flickr/tag.rb', line 36

def author
  @author
end

#idObject (readonly)

Returns the value of attribute id.



36
37
38
# File 'lib/net/flickr/tag.rb', line 36

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



36
37
38
# File 'lib/net/flickr/tag.rb', line 36

def name
  @name
end

#rawObject (readonly)

Returns the value of attribute raw.



36
37
38
# File 'lib/net/flickr/tag.rb', line 36

def raw
  @raw
end

Instance Method Details

#machine?Boolean

true if this tag is a machine tag, false otherwise.

Returns:

  • (Boolean)


49
50
51
# File 'lib/net/flickr/tag.rb', line 49

def machine?
  return @machine_tag
end