Class: Tablespoon::Doc
- Inherits:
-
Object
- Object
- Tablespoon::Doc
- Defined in:
- lib/tablespoon.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #get_table(x, opts = {}) ⇒ Object
-
#initialize(key, opts = {}) ⇒ Doc
constructor
A new instance of Doc.
Constructor Details
#initialize(key, opts = {}) ⇒ Doc
Returns a new instance of Doc.
11 12 13 14 15 16 17 18 |
# File 'lib/tablespoon.rb', line 11 def initialize( key, opts = {} ) if opts[:username] && opts [:password] @session = GoogleDrive.login( opts[:username], opts[:password] ) @doc = session.spreadsheet_by_key( key ) else raise "No username and password" end end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
9 10 11 |
# File 'lib/tablespoon.rb', line 9 def doc @doc end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
9 10 11 |
# File 'lib/tablespoon.rb', line 9 def session @session end |