Class: Rake::Migrations::Task
- Inherits:
-
Object
- Object
- Rake::Migrations::Task
- Defined in:
- lib/rake/migrations/task.rb
Constant Summary collapse
- RUN_ONCE =
:once
- RUN_EVERY_TIME =
:every
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #equal?)
-
#initialize(name, attrs = {}) ⇒ Task
constructor
A new instance of Task.
- #run_every_time? ⇒ Boolean
- #run_once? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
6 7 8 |
# File 'lib/rake/migrations/task.rb', line 6 def command @command end |
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
6 7 8 |
# File 'lib/rake/migrations/task.rb', line 6 def frequency @frequency end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/rake/migrations/task.rb', line 6 def name @name end |
Instance Method Details
#==(other) ⇒ Object Also known as: equal?
31 32 33 |
# File 'lib/rake/migrations/task.rb', line 31 def ==(other) name == other.name end |
#run_every_time? ⇒ Boolean
14 15 16 |
# File 'lib/rake/migrations/task.rb', line 14 def run_every_time? frequency == RUN_EVERY_TIME end |
#run_once? ⇒ Boolean
18 19 20 |
# File 'lib/rake/migrations/task.rb', line 18 def run_once? frequency == RUN_ONCE end |
#to_h ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/rake/migrations/task.rb', line 22 def to_h { name => { command: command, frequency: frequency } } end |