Class: LinkedRails::Sequence
- Inherits:
-
Object
- Object
- LinkedRails::Sequence
- Defined in:
- app/models/linked_rails/sequence.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
Returns the value of attribute node.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#raw_members ⇒ Object
Returns the value of attribute raw_members.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#user_context ⇒ Object
Returns the value of attribute user_context.
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(members, **opts) ⇒ Sequence
constructor
A new instance of Sequence.
- #iri(**_opts) ⇒ Object
- #members ⇒ Object
- #preview_includes ⇒ Object
- #rdf_type ⇒ Object
Constructor Details
#initialize(members, **opts) ⇒ Sequence
Returns a new instance of Sequence.
8 9 10 11 12 13 14 |
# File 'app/models/linked_rails/sequence.rb', line 8 def initialize(members, **opts) self.node = opts[:id] || RDF::Node.new self.parent = opts[:parent] self.raw_members = members self.scope = opts[:scope] self.user_context = opts[:user_context] end |
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node.
5 6 7 |
# File 'app/models/linked_rails/sequence.rb', line 5 def node @node end |
#parent ⇒ Object
Returns the value of attribute parent.
5 6 7 |
# File 'app/models/linked_rails/sequence.rb', line 5 def parent @parent end |
#raw_members ⇒ Object
Returns the value of attribute raw_members.
5 6 7 |
# File 'app/models/linked_rails/sequence.rb', line 5 def raw_members @raw_members end |
#scope ⇒ Object
Returns the value of attribute scope.
5 6 7 |
# File 'app/models/linked_rails/sequence.rb', line 5 def scope @scope end |
#user_context ⇒ Object
Returns the value of attribute user_context.
5 6 7 |
# File 'app/models/linked_rails/sequence.rb', line 5 def user_context @user_context end |
Class Method Details
.iri ⇒ Object
50 51 52 |
# File 'app/models/linked_rails/sequence.rb', line 50 def iri RDF[:Seq] end |
Instance Method Details
#id ⇒ Object
19 20 21 |
# File 'app/models/linked_rails/sequence.rb', line 19 def iri(**_opts) node end |
#iri(**_opts) ⇒ Object
16 17 18 |
# File 'app/models/linked_rails/sequence.rb', line 16 def iri(**_opts) node end |
#members ⇒ Object
21 22 23 24 25 |
# File 'app/models/linked_rails/sequence.rb', line 21 def members @members ||= apply_scope( raw_members.respond_to?(:call) ? raw_members.call : raw_members ) end |
#preview_includes ⇒ Object
27 28 29 |
# File 'app/models/linked_rails/sequence.rb', line 27 def preview_includes [:members] end |
#rdf_type ⇒ Object
31 32 33 |
# File 'app/models/linked_rails/sequence.rb', line 31 def rdf_type self.class.iri end |