Class: LinkedRails::Form::Page

Inherits:
Resource
  • Object
show all
Defined in:
app/models/linked_rails/form/page.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

Attributes inherited from Resource

#iri

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#anonymous_iri?

Methods included from Model

#build_child

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

#menu, #menu_list, #menus

Methods included from Model::IRI

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

Methods included from Model::Enhancements

#enhanced_with?

Methods included from Model::Dirty

#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

Constructor Details

#initialize(**attrs) ⇒ Page

Returns a new instance of Page.



9
10
11
12
# File 'app/models/linked_rails/form/page.rb', line 9

def initialize(**attrs)
  super(**attrs)
  self.groups = []
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'app/models/linked_rails/form/page.rb', line 6

def description
  @description
end

#groupsObject

Returns the value of attribute groups.



6
7
8
# File 'app/models/linked_rails/form/page.rb', line 6

def groups
  @groups
end

#key=(value) ⇒ Object (writeonly)

Sets the attribute key

Parameters:

  • value

    the value to set the attribute key to.



7
8
9
# File 'app/models/linked_rails/form/page.rb', line 7

def key=(value)
  @key = value
end

#labelObject

Returns the value of attribute label.



6
7
8
# File 'app/models/linked_rails/form/page.rb', line 6

def label
  @label
end

Class Method Details

.iriObject



29
30
31
# File 'app/models/linked_rails/form/page.rb', line 29

def iri
  Vocab.form[:Page]
end

Instance Method Details

#add_group(**opts) ⇒ Object



14
15
16
17
18
# File 'app/models/linked_rails/form/page.rb', line 14

def add_group(**opts)
  group = Form::Group.new(**opts)
  groups << group
  group
end


20
21
22
# File 'app/models/linked_rails/form/page.rb', line 20

def footer_group
  @footer_group ||= add_group(collapsible: false, footer: true, key: :footer)
end


24
25
26
# File 'app/models/linked_rails/form/page.rb', line 24

def footer_group!
  @footer_group
end