class API::Tag

Attributes

tag[R]

Public Class Methods

find_by_name(name) click to toggle source
# File lib/quintype/api/tag.rb, line 19
def find_by_name(name)
  if tag = API.tag_by_name(URI.encode(name))
    wrap(tag)
  end
end
new(tag) click to toggle source
# File lib/quintype/api/tag.rb, line 26
def initialize(tag)
  @tag = tag
end
wrap(tag) click to toggle source
# File lib/quintype/api/tag.rb, line 15
def wrap(tag)
  new(tag) if tag
end
wrap_all(tags) click to toggle source
# File lib/quintype/api/tag.rb, line 8
def wrap_all(tags)
  tags ||= []
  tags.is_a?(Array) ?
    tags.map {|t| wrap(t)} :
    wrap(tags)
end

Public Instance Methods

to_h(config={}) click to toggle source
# File lib/quintype/api/tag.rb, line 30
def to_h(config={})
  self.tag["tag"]
end