module Rooftop::ResourceLinks::ClassMethods
Attributes
resource_link_mapping[RW]
This class-level attribute allows us to set a mapping between a resource link name (which is probably an href, but might be “up” or something) and a class. It means that when we try to resolve a link of a given name, we know what type of class to instantiate
Public Instance Methods
configure_resource_link_mapping()
click to toggle source
# File lib/rooftop/resource_links/resource_links.rb, line 26 def configure_resource_link_mapping @resource_link_mapping ||= {} @resource_link_mapping.merge!({ "author" => Rooftop::Author, "https://api.w.org/attachment" => Rooftop::MediaItem, "self" => self, "up" => self, "http://docs.rooftopcms.com/link_relations/ancestors" => self, "http://docs.rooftopcms.com/link_relations/children" => self }) end