Class: QuickBase::Objects::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/QuickBaseObjects.rb

Overview

Definition and content of a page associated with an Application.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content.



330
331
332
# File 'lib/QuickBaseObjects.rb', line 330

def content
  @content
end

#idObject (readonly)

Returns the value of attribute id.



330
331
332
# File 'lib/QuickBaseObjects.rb', line 330

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



330
331
332
# File 'lib/QuickBaseObjects.rb', line 330

def name
  @name
end

#typeObject (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