Class: Mxrb::Model::Page
Overview
$Type: Pages$Page / Forms$Page ContainmentName: "Documents"
Instance Attribute Summary collapse
-
#allowed_module_roles ⇒ Object
readonly
Returns the value of attribute allowed_module_roles.
-
#data_source ⇒ Object
readonly
Returns the value of attribute data_source.
-
#documentation ⇒ Object
readonly
Returns the value of attribute documentation.
-
#excluded ⇒ Object
readonly
Returns the value of attribute excluded.
-
#export_level ⇒ Object
readonly
Returns the value of attribute export_level.
-
#layout_id ⇒ Object
readonly
Returns the value of attribute layout_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#popup_height ⇒ Object
readonly
Returns the value of attribute popup_height.
-
#popup_resizable ⇒ Object
readonly
Returns the value of attribute popup_resizable.
-
#popup_width ⇒ Object
readonly
Returns the value of attribute popup_width.
-
#raw_document ⇒ Object
readonly
Returns the value of attribute raw_document.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#widgets ⇒ Object
readonly
Returns the value of attribute widgets.
Attributes inherited from Unit
#bson_type, #container_id, #containment_name, #id, #mpr
Instance Method Summary collapse
Methods inherited from Unit
Constructor Details
This class inherits a constructor from Mxrb::Model::Unit
Instance Attribute Details
#allowed_module_roles ⇒ Object (readonly)
Returns the value of attribute allowed_module_roles.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def allowed_module_roles @allowed_module_roles end |
#data_source ⇒ Object (readonly)
Returns the value of attribute data_source.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def data_source @data_source end |
#documentation ⇒ Object (readonly)
Returns the value of attribute documentation.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def documentation @documentation end |
#excluded ⇒ Object (readonly)
Returns the value of attribute excluded.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def excluded @excluded end |
#export_level ⇒ Object (readonly)
Returns the value of attribute export_level.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def export_level @export_level end |
#layout_id ⇒ Object (readonly)
Returns the value of attribute layout_id.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def layout_id @layout_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def name @name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def parameters @parameters end |
#popup_height ⇒ Object (readonly)
Returns the value of attribute popup_height.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def popup_height @popup_height end |
#popup_resizable ⇒ Object (readonly)
Returns the value of attribute popup_resizable.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def popup_resizable @popup_resizable end |
#popup_width ⇒ Object (readonly)
Returns the value of attribute popup_width.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def popup_width @popup_width end |
#raw_document ⇒ Object (readonly)
Returns the value of attribute raw_document.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def raw_document @raw_document end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def url @url end |
#widgets ⇒ Object (readonly)
Returns the value of attribute widgets.
10 11 12 |
# File 'lib/mxrb/model/page.rb', line 10 def @widgets end |
Instance Method Details
#decode(doc) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mxrb/model/page.rb', line 15 def decode(doc) @raw_document = doc @storage_type = doc["$Type"] || "Forms$Page" @name = doc["Name"] || doc["name"] @documentation = doc["Documentation"] || doc["documentation"] || "" @url = doc["Url"] || doc["URL"] || doc["url"] || "" @title = extract_text(doc["Title"] || doc["title"]) @layout_id = extract_layout(doc) @popup_width = doc["PopupWidth"] || 0 @popup_height = doc["PopupHeight"] || 0 @popup_resizable = doc["PopupResizable"] == true @excluded = doc["Excluded"] == true @export_level = doc["ExportLevel"] || "Hidden" @allowed_module_roles = parse_array(doc["AllowedModuleRoles"] || doc["AllowedRoles"] || doc["allowedModuleRoles"]) @parameters = parse_array(doc["Parameters"] || doc["parameters"]) @widgets = [] ((doc)) end |
#inspect ⇒ Object
54 55 56 |
# File 'lib/mxrb/model/page.rb', line 54 def inspect "#<Mxrb::Page name=#{@name.inspect} layout=#{@layout_id.to_s.slice(0, 8)}>" end |
#to_bson ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/mxrb/model/page.rb', line 34 def to_bson { "$ID" => @id, "$Type" => @storage_type, "Name" => @name, "Documentation" => @documentation || "", "Url" => @url || "", "Title" => serialize_title, "Layout" => @layout_id, "MarkAsUsed" => false, "Excluded" => @excluded || false, "AllowedModuleRoles" => IO::BsonCodec.build_array(@allowed_module_roles || [], marker: 1), "Parameters" => IO::BsonCodec.build_array(@parameters || []), "PopupWidth" => @popup_width || 0, "PopupHeight" => @popup_height || 0, "PopupResizable" => @popup_resizable || false, "ExportLevel" => @export_level || "Hidden", } end |