Class: Rake::DataTask::Data
- Inherits:
-
Object
- Object
- Rake::DataTask::Data
- Defined in:
- lib/data_task/data.rb
Overview
Represents a table accessed via a database, roughly analogous to the File class.
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #exists?(options = {}) ⇒ Boolean (also: #exist?)
-
#initialize(data_name, adapter) ⇒ Data
constructor
A new instance of Data.
- #mtime ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(data_name, adapter) ⇒ Data
Returns a new instance of Data.
12 13 14 15 |
# File 'lib/data_task/data.rb', line 12 def initialize data_name, adapter @name = data_name @adapter = adapter end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
10 11 12 |
# File 'lib/data_task/data.rb', line 10 def adapter @adapter end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/data_task/data.rb', line 9 def name @name end |
Instance Method Details
#exists?(options = {}) ⇒ Boolean Also known as: exist?
17 18 19 |
# File 'lib/data_task/data.rb', line 17 def exists? ={} @adapter.data_exists?(@name, ) end |
#mtime ⇒ Object
23 24 25 |
# File 'lib/data_task/data.rb', line 23 def mtime @adapter.data_mtime(@name) end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/data_task/data.rb', line 27 def to_s @name end |