Class: Page
Instance Attribute Summary collapse
-
#blocks ⇒ Object
readonly
Returns the value of attribute blocks.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Element
#hidden, #id, #initial, #page, #page_id, #text, #type
Instance Method Summary collapse
-
#initialize(entry) ⇒ Page
constructor
A new instance of Page.
- #set_block(id, block) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Element
#has_links?, #hide, #is_hidden?, #is_initial?, #is_state?, #link_from, #link_to, #links_from, #links_from_type, #links_to, #links_to_type, #set_initial, #set_page
Constructor Details
#initialize(entry) ⇒ Page
Returns a new instance of Page.
81 82 83 84 85 86 |
# File 'lib/lucidMachines/elements.rb', line 81 def initialize(entry) super(entry) puts "ERROR: You cannot create this page" unless is_page? entry @name = entry["Text Area 1"] @blocks = {} end |
Instance Attribute Details
#blocks ⇒ Object (readonly)
Returns the value of attribute blocks.
79 80 81 |
# File 'lib/lucidMachines/elements.rb', line 79 def blocks @blocks end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
78 79 80 |
# File 'lib/lucidMachines/elements.rb', line 78 def name @name end |
Instance Method Details
#set_block(id, block) ⇒ Object
88 89 90 91 |
# File 'lib/lucidMachines/elements.rb', line 88 def set_block(id, block) @blocks[id] = block block.set_page(self) end |
#to_s ⇒ Object
93 94 95 |
# File 'lib/lucidMachines/elements.rb', line 93 def to_s "Page: " + @name.to_s end |