Class: QuickBase::Objects::Page
- Inherits:
-
Object
- Object
- QuickBase::Objects::Page
- Defined in:
- lib/QuickBaseObjects.rb
Overview
Definition and content of a page associated with an Application.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #build(pageHash) ⇒ Object
-
#initialize(pageHash = nil) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(pageHash = nil) ⇒ Page
Returns a new instance of Page.
331 332 333 |
# File 'lib/QuickBaseObjects.rb', line 331 def initialize(pageHash=nil) build(pageHash) if pageHash end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
330 331 332 |
# File 'lib/QuickBaseObjects.rb', line 330 def content @content end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
330 331 332 |
# File 'lib/QuickBaseObjects.rb', line 330 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
330 331 332 |
# File 'lib/QuickBaseObjects.rb', line 330 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
330 331 332 |
# File 'lib/QuickBaseObjects.rb', line 330 def type @type end |
Instance Method Details
#build(pageHash) ⇒ Object
334 335 336 337 338 339 340 341 342 |
# File 'lib/QuickBaseObjects.rb', line 334 def build(pageHash) raise "#{pageHash} is not a Hash." if !pageHash.is_a?(Hash) @id = pageHash["id"] if pageHash["id"] @name = pageHash["name"] if pageHash["name"] @name ||= "Unnamed page" @type = pageHash["type"] if pageHash["type"] @type ||= "1" @content = pageHash["content"] if pageHash["content"] end |