class Tripod::Links::LinkedTo

Defines the behaviour for defined links in the resource.

Attributes

class_name[RW]

Set readers for the instance variables.

field_name[RW]

Set readers for the instance variables.

multivalued[RW]

Set readers for the instance variables.

multivalued?[RW]

Set readers for the instance variables.

name[RW]

Set readers for the instance variables.

options[RW]

Set readers for the instance variables.

predicate[RW]

Set readers for the instance variables.

Public Class Methods

new(name, predicate, options = {}) click to toggle source

Create the new link with a name and optional additional options.

# File lib/tripod/links/linked_to.rb, line 11
def initialize(name, predicate, options = {})
  @name = name
  @options = options
  @predicate = RDF::URI.new(predicate.to_s)
  @multivalued = options[:multivalued] || false
  @class_name = options[:class_name] || @name.to_s.classify
  @field_name = options[:field_name] || (@name.to_s + ( @multivalued ? "_uris" : "_uri" )).to_sym

end