Class: Tripod::Links::LinkedFrom
- Inherits:
-
Object
- Object
- Tripod::Links::LinkedFrom
- Defined in:
- lib/tripod/links/linked_from.rb
Overview
Defines the behaviour for defined links in the resource.
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Set readers for the instance variables.
-
#incoming_field ⇒ Object
Set readers for the instance variables.
-
#incoming_field_name ⇒ Object
Set readers for the instance variables.
-
#name ⇒ Object
Set readers for the instance variables.
-
#options ⇒ Object
Set readers for the instance variables.
Instance Method Summary collapse
-
#initialize(name, incoming_field_name, options = {}) ⇒ LinkedFrom
constructor
Create the new link with a name and optional additional options.
Constructor Details
#initialize(name, incoming_field_name, options = {}) ⇒ LinkedFrom
Create the new link with a name and optional additional options.
10 11 12 13 14 15 16 17 |
# File 'lib/tripod/links/linked_from.rb', line 10 def initialize(name, incoming_field_name, = {}) @name = name @options = @incoming_field_name = incoming_field_name # if class name not supplied, guess from the field name @class_name = [:class_name] || name.to_s.singularize.classify end |
Instance Attribute Details
#class_name ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_from.rb', line 7 def class_name @class_name end |
#incoming_field ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_from.rb', line 7 def incoming_field @incoming_field end |
#incoming_field_name ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_from.rb', line 7 def incoming_field_name @incoming_field_name end |
#name ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_from.rb', line 7 def name @name end |
#options ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_from.rb', line 7 def @options end |