class Rooftop::Taxonomy

Public Class Methods

all() click to toggle source
# File lib/rooftop/models/taxonomy.rb, line 10
def self.all
  taxonomies = []
  get_raw(self.collection_path) do |parsed, raw|
    parsed[:data].each do |tax,data|
      taxonomies << Taxonomy.new(data)
    end
  end
  taxonomies.each do |t|
    t.run_callbacks(:find)
  end
  return taxonomies
end

Public Instance Methods

terms() click to toggle source
# File lib/rooftop/models/taxonomy.rb, line 23
def terms
  TaxonomyTerm.get(resource_links.find_by(link_type: "wp:items").first.href)
end