Class: LinkedRails::EntryPoint

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, Model
Defined in:
app/models/linked_rails/entry_point.rb

Constant Summary

Constants included from Model::Collections

Model::Collections::COLLECTION_CUSTOMIZABLE_OPTIONS, Model::Collections::COLLECTION_OPTIONS, Model::Collections::COLLECTION_STATIC_OPTIONS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Model

#build_child

Methods included from Model::Singularable

#root_relative_iri, #root_relative_singular_iri, #singular_iri, #singular_iri_opts, #singular_iri_template, #singular_resource?

Methods included from Model::Serialization

#preview_includes, #show_includes

Methods included from Model::Menuable

#menu, #menu_list, #menus

Methods included from Model::Iri

#anonymous_iri, #anonymous_iri?, #iri, #iri_elements, #iri_opts, #rdf_type, #reload, #root_relative_iri

Methods included from Model::Enhancements

#enhanced_with?

Methods included from Model::Dirty

#previous_changes_by_predicate, #previously_changed_relations

Methods included from Model::Collections

#collection_for, #collection_iri, #collection_options_for, #collection_root_relative_iri, #parent_collections

Methods included from Model::Actionable

#action, #action_list, #action_triples, #actions, #collection_actions, #favorite_actions

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



8
9
10
# File 'app/models/linked_rails/entry_point.rb', line 8

def parent
  @parent
end

#target_urlObject



36
37
38
# File 'app/models/linked_rails/entry_point.rb', line 36

def target_url
  @target_url || parent.target_url
end

Class Method Details

.iriObject



51
52
53
# File 'app/models/linked_rails/entry_point.rb', line 51

def iri
  Vocab.schema.EntryPoint
end

Instance Method Details

#action_bodyObject



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_templateObject



23
24
25
26
27
28
# File 'app/models/linked_rails/entry_point.rb', line 23

def iri_template
  @iri_template ||= iri_template_with_fragment(
    LinkedRails::URITemplate.new(parent.root_relative_iri.to_s),
    :EntryPoint
  )
end

#labelObject



30
31
32
33
34
# File 'app/models/linked_rails/entry_point.rb', line 30

def label
  var = parent.submit_label
  value = var.respond_to?(:call) ? parent.list.instance_exec(&var) : var
  value || label_fallback
end