Class: QuickBase::RSSGenerator::Table
- Inherits:
-
Object
- Object
- QuickBase::RSSGenerator::Table
- Defined in:
- lib/QuickBaseRSSGenerator.rb
Overview
Nested class to encapsulate RSS retrieval options for a QuickBase table.
Instance Attribute Summary collapse
-
#clist ⇒ Object
readonly
Returns the value of attribute clist.
-
#dbid ⇒ Object
readonly
Returns the value of attribute dbid.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#numRecords ⇒ Object
readonly
Returns the value of attribute numRecords.
-
#optionalFields ⇒ Object
readonly
Returns the value of attribute optionalFields.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#qid ⇒ Object
readonly
Returns the value of attribute qid.
-
#qname ⇒ Object
readonly
Returns the value of attribute qname.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#slist ⇒ Object
readonly
Returns the value of attribute slist.
-
#tableName ⇒ Object
readonly
Returns the value of attribute tableName.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(dbid, tableName, fields, query = nil, qid = nil, qname = nil, numRecords = 0, slist = "2", options = "sortorder-D") ⇒ Table
constructor
‘tableName’ is the table name as it should appear in the output.
Constructor Details
#initialize(dbid, tableName, fields, query = nil, qid = nil, qname = nil, numRecords = 0, slist = "2", options = "sortorder-D") ⇒ Table
‘tableName’ is the table name as it should appear in the output. Gets all records by default, sorted by Date Modified (“2”) in descending order. Only retrieves fields in ‘fields’ parameter. <pubDate> is set to Date Modified (“2”) by default <link> is set to Record ID# (“3”) by default any additional quickbase field can be included in ‘fields’
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/QuickBaseRSSGenerator.rb', line 49 def initialize( dbid, tableName, fields, query = nil, qid = nil, qname = nil, numRecords = 0, slist = "2", = "sortorder-D" ) raise "fields parameter must be a Hash" if !fields.is_a?( Hash ) @dbid, @tableName, @fields = dbid, tableName, fields @query, @qid, @qname, @numRecords, @slist, @options = query, qid, qname, numRecords, slist, @fields["pubDate"] = "2" if @fields["pubDate"].nil? @fields["link"] = "3" if @fields["link"].nil? @optionalFields = Hash.new @clist = "" if @fields["description"] and @fields["title"] @fields.each{ |k,v| @clist << "#{v}." if k != "pubDate" and k != "link" and k != "description" and k != "title" @optionalFields[v] = k end } @clist[-1] = "" else raise "fields parameter must include a 'description' and 'title'" end @title = "Default RSS Item Title" @link = "http://www.quickbase.com/db/main" @description = "Default RSS item description" @options << ".num-#{numRecords}" if numRecords > 0 end |
Instance Attribute Details
#clist ⇒ Object (readonly)
Returns the value of attribute clist.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def clist @clist end |
#dbid ⇒ Object (readonly)
Returns the value of attribute dbid.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def dbid @dbid end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
40 41 42 |
# File 'lib/QuickBaseRSSGenerator.rb', line 40 def description @description end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def fields @fields end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
40 41 42 |
# File 'lib/QuickBaseRSSGenerator.rb', line 40 def link @link end |
#numRecords ⇒ Object (readonly)
Returns the value of attribute numRecords.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def numRecords @numRecords end |
#optionalFields ⇒ Object (readonly)
Returns the value of attribute optionalFields.
40 41 42 |
# File 'lib/QuickBaseRSSGenerator.rb', line 40 def optionalFields @optionalFields end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def @options end |
#qid ⇒ Object (readonly)
Returns the value of attribute qid.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def qid @qid end |
#qname ⇒ Object (readonly)
Returns the value of attribute qname.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def qname @qname end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def query @query end |
#slist ⇒ Object (readonly)
Returns the value of attribute slist.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def slist @slist end |
#tableName ⇒ Object (readonly)
Returns the value of attribute tableName.
39 40 41 |
# File 'lib/QuickBaseRSSGenerator.rb', line 39 def tableName @tableName end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
40 41 42 |
# File 'lib/QuickBaseRSSGenerator.rb', line 40 def title @title end |