Class: Ecoportal::API::V2::Page::Force
- Inherits:
-
Common::Content::DoubleModel
- Object
- Common::BaseModel
- Common::Content::DoubleModel
- Ecoportal::API::V2::Page::Force
- Defined in:
- lib/ecoportal/api/v2/page/force.rb,
lib/ecoportal/api/v2/page/force/helper.rb,
lib/ecoportal/api/v2/page/force/binding.rb,
lib/ecoportal/api/v2/page/force/bindings.rb
Defined Under Namespace
Classes: Binding, Bindings, Helper
Constant Summary collapse
- INITIAL_WEIGHT =
9999
Constants included from Common::Content::DoubleModel::Diffable
Common::Content::DoubleModel::Diffable::DIFF_CLASS
Constants included from Common::Content::DoubleModel::Base
Common::Content::DoubleModel::Base::NOT_USED
Instance Attribute Summary
Attributes included from Common::Content::DoubleModel::Parented
Class Method Summary collapse
Instance Method Summary collapse
- #bind(reference, **kargs, &block) ⇒ Object
-
#custom_script=(value) ⇒ Object
It updates
scriptby usinghelpers. - #ooze ⇒ Object
-
#update_script ⇒ Object
It sets the
scriptvalue by usingcustom_scriptandhelpers[N..1].script.
Methods inherited from Common::Content::DoubleModel
Methods included from Common::Content::DoubleModel::Diffable
Methods included from Common::Content::Includer
Constructor Details
This class inherits a constructor from Ecoportal::API::Common::Content::DoubleModel
Class Method Details
.new_doc ⇒ Object
9 10 11 12 13 14 |
# File 'lib/ecoportal/api/v2/page/force.rb', line 9 def new_doc { 'id' => new_uuid, 'weight' => INITIAL_WEIGHT } end |
Instance Method Details
#bind(reference, **kargs, &block) ⇒ Object
34 35 36 |
# File 'lib/ecoportal/api/v2/page/force.rb', line 34 def bind(reference, **kargs, &block) bindings.add(reference, **kargs, &block) end |
#custom_script=(value) ⇒ Object
It updates script by using helpers
39 40 41 42 |
# File 'lib/ecoportal/api/v2/page/force.rb', line 39 def custom_script=(value) doc['custom_script'] = value update_script end |
#ooze ⇒ Object
29 30 31 |
# File 'lib/ecoportal/api/v2/page/force.rb', line 29 def ooze _parent.ooze end |
#update_script ⇒ Object
It sets the script value by using custom_script and helpers[N..1].script
45 46 47 |
# File 'lib/ecoportal/api/v2/page/force.rb', line 45 def update_script doc['script'] = helpers.to_a.reverse.map(&:script).push(custom_script).join("\n") end |