class Tripod::Links::LinkedFrom

Defines the behaviour for defined links in the resource.

Attributes

class_name[RW]

Set readers for the instance variables.

incoming_field[RW]

Set readers for the instance variables.

incoming_field_name[RW]

Set readers for the instance variables.

name[RW]

Set readers for the instance variables.

options[RW]

Set readers for the instance variables.

Public Class Methods

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

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

# File lib/tripod/links/linked_from.rb, line 10
def initialize(name, incoming_field_name, options = {})
  @name = name
  @options = options
  @incoming_field_name = incoming_field_name
  # if class name not supplied, guess from the field name
  @class_name = options[:class_name] || name.to_s.singularize.classify

end