Sha256: 5cf37b56a2c2cb1e5a23179d06ae5491c1b7f34b0dd9504b77b32e0a7a00d239
Contents?: true
Size: 1.68 KB
Versions: 1
Compression:
Stored size: 1.68 KB
Contents
module Ecoportal module API class V2 class Page class Force < Common::Content::DoubleModel INITIAL_WEIGHT = 9999 class << self def new_doc { "id" => new_uuid, "weight" => INITIAL_WEIGHT } end end class_resolver :bindings_class, "Ecoportal::API::V2::Page::Force::Bindings" class_resolver :helper_class, "Ecoportal::API::V2::Page::Force::Helper" passkey :id passforced :patch_ver, default: 1 passthrough :name, :weight passdate :last_synced_at passthrough :custom_script passthrough :script, read_only: true embeds_many :bindings, enum_class: :bindings_class embeds_many :helpers, klass: :helper_class def ooze _parent.ooze end # @see Ecoportal::API::V2::Page::Force::Bindings#add def bind(reference, **kargs, &block) bindings.add(reference, **kargs, &block) end # It updates `script` by using `helpers` def custom_script=(value) doc["custom_script"] = value update_script end # It sets the `script` value by using `custom_script` and `helpers[N..1].script` def update_script doc["script"] = helpers.to_a.reverse.map(&:script).push(self.custom_script).join("\n") end end end end end end require 'ecoportal/api/v2/page/force/helper' require 'ecoportal/api/v2/page/force/binding' require 'ecoportal/api/v2/page/force/bindings'
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ecoportal-api-v2-1.1.8 | lib/ecoportal/api/v2/page/force.rb |