Class: Page

Inherits:
Element show all
Defined in:
lib/lucidMachines/elements.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#hidden, #id, #initial, #page, #page_id, #text, #type

Instance Method Summary collapse

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

#blocksObject (readonly)

Returns the value of attribute blocks.



79
80
81
# File 'lib/lucidMachines/elements.rb', line 79

def blocks
  @blocks
end

#nameObject (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_sObject



93
94
95
# File 'lib/lucidMachines/elements.rb', line 93

def to_s
  "Page: " + @name.to_s
end