Class: Ecoportal::API::V2::Page::Force::Binding
- Inherits:
-
Common::Content::DoubleModel
- Object
- Common::BaseModel
- Common::Content::DoubleModel
- Ecoportal::API::V2::Page::Force::Binding
- Defined in:
- lib/ecoportal/api/v2/page/force/binding.rb
Constant Summary collapse
- COMPONENT_TYPE =
"membrane_binding"- SECTION_TYPE =
"flow_node_binding"
Constants inherited from Common::Content::DoubleModel
Common::Content::DoubleModel::NOT_USED
Constants included from Common::Content::ClassHelpers
Common::Content::ClassHelpers::NOT_USED
Instance Attribute Summary
Attributes inherited from Common::Content::DoubleModel
Class Method Summary collapse
Instance Method Summary collapse
-
#component ⇒ Ecoportal::API::V2::Page::Component
Field referenced by this binding.
-
#component? ⇒ Boolean
Whether or not this the binding refers to a Component.
- #ooze ⇒ Object
-
#section ⇒ Ecoportal::API::V2::Page::Section
Section referenced by this binding.
-
#section? ⇒ Boolean
Whether or not this the binding refers to a Section.
Methods inherited from Common::Content::DoubleModel
#_doc_key, #as_json, #as_update, #consolidate!, #dirty?, #doc, embeds_many, embeds_one, enforce!, #initialize, #key, #key=, key?, new_uuid, #original_doc, pass_reader, pass_writer, passarray, passboolean, passdate, passforced, passkey, passthrough, #print_pretty, #replace_doc, #reset!, #root, #to_json
Methods included from Common::Content::ClassHelpers
#inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant, #to_time, #used_param?
Constructor Details
This class inherits a constructor from Ecoportal::API::Common::Content::DoubleModel
Class Method Details
.new_doc ⇒ Object
8 9 10 11 12 |
# File 'lib/ecoportal/api/v2/page/force/binding.rb', line 8 def new_doc { "id" => new_uuid } end |
Instance Method Details
#component ⇒ Ecoportal::API::V2::Page::Component
Returns field referenced by this binding.
36 37 38 39 |
# File 'lib/ecoportal/api/v2/page/force/binding.rb', line 36 def component raise "This is not a component binding, but a section binding" unless component? ooze.components.get_by_id(reference_id) end |
#component? ⇒ Boolean
Returns whether or not this the binding refers to a Component.
26 27 28 |
# File 'lib/ecoportal/api/v2/page/force/binding.rb', line 26 def component? type == COMPONENT_TYPE end |
#ooze ⇒ Object
21 22 23 |
# File 'lib/ecoportal/api/v2/page/force/binding.rb', line 21 def ooze self._parent.ooze end |
#section ⇒ Ecoportal::API::V2::Page::Section
Returns section referenced by this binding.
42 43 44 45 |
# File 'lib/ecoportal/api/v2/page/force/binding.rb', line 42 def section raise "This is not a section binding, but a component binding" unless section? ooze.sections.get_by_id(reference_id) end |
#section? ⇒ Boolean
Returns whether or not this the binding refers to a Section.
31 32 33 |
# File 'lib/ecoportal/api/v2/page/force/binding.rb', line 31 def section? type == SECTION_TYPE end |