Class: Rake::DataTask::Data

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#adapterObject

Returns the value of attribute adapter.



10
11
12
# File 'lib/data_task/data.rb', line 10

def adapter
  @adapter
end

#nameObject

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?

Returns:

  • (Boolean)


17
18
19
# File 'lib/data_task/data.rb', line 17

def exists? options={}
  @adapter.data_exists?(@name, options)
end

#mtimeObject



23
24
25
# File 'lib/data_task/data.rb', line 23

def mtime
  @adapter.data_mtime(@name)
end

#to_sObject



27
28
29
# File 'lib/data_task/data.rb', line 27

def to_s
  @name
end