Class: Tripod::Links::LinkedTo
- Inherits:
-
Object
- Object
- Tripod::Links::LinkedTo
- Defined in:
- lib/tripod/links/linked_to.rb
Overview
Defines the behaviour for defined links in the resource.
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Set readers for the instance variables.
-
#field_name ⇒ Object
Set readers for the instance variables.
-
#multivalued ⇒ Object
(also: #multivalued?)
Set readers for the instance variables.
-
#name ⇒ Object
Set readers for the instance variables.
-
#options ⇒ Object
Set readers for the instance variables.
-
#predicate ⇒ Object
Set readers for the instance variables.
Instance Method Summary collapse
-
#initialize(name, predicate, options = {}) ⇒ LinkedTo
constructor
Create the new link with a name and optional additional options.
Constructor Details
#initialize(name, predicate, options = {}) ⇒ LinkedTo
Create the new link with a name and optional additional options.
11 12 13 14 15 16 17 18 19 |
# File 'lib/tripod/links/linked_to.rb', line 11 def initialize(name, predicate, = {}) @name = name @options = @predicate = RDF::URI.new(predicate.to_s) @multivalued = [:multivalued] || false @class_name = [:class_name] || @name.to_s.classify @field_name = [:field_name] || (@name.to_s + ( @multivalued ? "_uris" : "_uri" )).to_sym end |
Instance Attribute Details
#class_name ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_to.rb', line 7 def class_name @class_name end |
#field_name ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_to.rb', line 7 def field_name @field_name end |
#multivalued ⇒ Object Also known as: multivalued?
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_to.rb', line 7 def multivalued @multivalued end |
#name ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_to.rb', line 7 def name @name end |
#options ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_to.rb', line 7 def @options end |
#predicate ⇒ Object
Set readers for the instance variables.
7 8 9 |
# File 'lib/tripod/links/linked_to.rb', line 7 def predicate @predicate end |