Class: LinkedRails::EntryPoint
- Inherits:
-
Object
- Object
- LinkedRails::EntryPoint
- Includes:
- ActiveModel::Model, Model
- Defined in:
- app/models/linked_rails/entry_point.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
- #url ⇒ Object
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Model
#build_child, #singular_resource?
Methods included from Model::Serialization
#preview_includes, #show_includes
Methods included from Model::Iri
#anonymous_iri, #anonymous_iri?, #iri, #iri_opts, #rdf_type, #reload, #root_relative_iri
Methods included from Model::Enhancements
Methods included from Model::Dirty
#previous_changes_by_predicate, #previously_changed_relations
Methods included from Model::Collections
#collection_for, #parent_collections
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
8 9 10 |
# File 'app/models/linked_rails/entry_point.rb', line 8 def parent @parent end |
#url ⇒ Object
33 34 35 |
# File 'app/models/linked_rails/entry_point.rb', line 33 def url @url || parent.url end |
Class Method Details
.iri ⇒ Object
48 49 50 |
# File 'app/models/linked_rails/entry_point.rb', line 48 def iri Vocab.schema.EntryPoint end |
Instance Method Details
#action_body ⇒ Object
13 14 15 16 17 |
# File 'app/models/linked_rails/entry_point.rb', line 13 def action_body return form if form.is_a?(RDF::URI) form&.form_iri end |
#as_json(_opts = {}) ⇒ Object
19 20 21 |
# File 'app/models/linked_rails/entry_point.rb', line 19 def as_json(_opts = {}) {} end |
#iri_template ⇒ Object
23 24 25 |
# File 'app/models/linked_rails/entry_point.rb', line 23 def iri_template @iri_template ||= iri_template_with_fragment(URITemplate.new(parent.root_relative_iri.to_s), :EntryPoint) end |
#label ⇒ Object
27 28 29 30 31 |
# File 'app/models/linked_rails/entry_point.rb', line 27 def label var = parent.submit_label value = var.respond_to?(:call) ? parent.list.instance_exec(&var) : var value || label_fallback end |