Class: CouchTap::Schema
- Inherits:
-
Object
- Object
- CouchTap::Schema
- Defined in:
- lib/couch_tap/schema.rb
Overview
Wrapper around a sequel table definition to allow easy access to column names.
Instance Attribute Summary collapse
-
#column_names ⇒ Object
Returns the value of attribute column_names.
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#database ⇒ Object
Returns the value of attribute database.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #dataset ⇒ Object
-
#initialize(database, name) ⇒ Schema
constructor
A new instance of Schema.
Constructor Details
#initialize(database, name) ⇒ Schema
Returns a new instance of Schema.
9 10 11 12 13 14 15 |
# File 'lib/couch_tap/schema.rb', line 9 def initialize(database, name) self.name = name.to_sym self.database = database self.columns = {} self.column_names = [] parse_schema end |
Instance Attribute Details
#column_names ⇒ Object
Returns the value of attribute column_names.
7 8 9 |
# File 'lib/couch_tap/schema.rb', line 7 def column_names @column_names end |
#columns ⇒ Object
Returns the value of attribute columns.
7 8 9 |
# File 'lib/couch_tap/schema.rb', line 7 def columns @columns end |
#database ⇒ Object
Returns the value of attribute database.
7 8 9 |
# File 'lib/couch_tap/schema.rb', line 7 def database @database end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/couch_tap/schema.rb', line 7 def name @name end |
Instance Method Details
#dataset ⇒ Object
17 18 19 |
# File 'lib/couch_tap/schema.rb', line 17 def dataset database[name] end |