Class: RubyRest::Resource::Sequel
Instance Attribute Summary collapse
-
#dataset ⇒ Object
readonly
Returns the value of attribute dataset.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(app, name) ⇒ Sequel
constructor
Creates a new resource, under the given application.
-
#table(name) ⇒ Object
Provides access to an arbitrary table.
Methods inherited from Base
atom, link, links, mount_point, mutable_props, props, related, related_resources, #resource, #to_s, with_mount_point, with_mutable_props
Constructor Details
#initialize(app, name) ⇒ Sequel
Creates a new resource, under the given application
87 88 89 90 |
# File 'lib/rubyrest/resource.rb', line 87 def initialize( app, name ) super( app, name ) @dataset = app.db[self.class.table_name] end |
Instance Attribute Details
#dataset ⇒ Object (readonly)
Returns the value of attribute dataset.
84 85 86 |
# File 'lib/rubyrest/resource.rb', line 84 def dataset @dataset end |
Class Method Details
.table_name ⇒ Object
101 102 103 |
# File 'lib/rubyrest/resource.rb', line 101 def self.table_name @table_name end |
.with_table_name(table_name) ⇒ Object
97 98 99 |
# File 'lib/rubyrest/resource.rb', line 97 def self.with_table_name table_name @table_name = table_name end |
Instance Method Details
#table(name) ⇒ Object
Provides access to an arbitrary table
93 94 95 |
# File 'lib/rubyrest/resource.rb', line 93 def table( name ) app.db[name] end |