Class: LinkedRails::Ontology::Base
- Inherits:
-
Object
- Object
- LinkedRails::Ontology::Base
- Includes:
- ActiveModel::Model, Model
- Defined in:
- app/models/linked_rails/ontology/base.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
-
#iri ⇒ Object
Returns the value of attribute iri.
Instance Method Summary collapse
Methods included from Model
Methods included from Model::Singularable
#root_relative_iri, #root_relative_singular_iri, #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
Methods included from Model::IRI
#anonymous_iri, #anonymous_iri?, #iri_elements, #iri_opts, #rdf_type, #reload, #root_relative_iri, #route_fragment
Methods included from Model::Enhancements
Methods included from Model::Dirty
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
#iri ⇒ Object
Returns the value of attribute iri.
8 9 10 |
# File 'app/models/linked_rails/ontology/base.rb', line 8 def iri @iri end |
Instance Method Details
#data ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/models/linked_rails/ontology/base.rb', line 10 def data data = [] iri.try(:each_statement) do |statement| next unless include_data_statement?(statement) statement.graph_name = ::RDF::Serializers.config.default_graph data << statement end data end |
#description ⇒ Object
21 22 23 24 25 |
# File 'app/models/linked_rails/ontology/base.rb', line 21 def description @description ||= LinkedRails.translations( -> { LinkedRails.translate(self.class.translation_key, :description, iri) } ) end |
#image ⇒ Object
27 28 29 |
# File 'app/models/linked_rails/ontology/base.rb', line 27 def image @image ||= RDF::URI("http://fontawesome.io/icon/#{icon}") if icon end |
#label ⇒ Object
31 32 33 34 35 |
# File 'app/models/linked_rails/ontology/base.rb', line 31 def label @label ||= LinkedRails.translations( -> { LinkedRails.translate(self.class.translation_key, :label, iri) } ) end |