class Rake::Migrations::Task

Constants

RUN_EVERY_TIME
RUN_ONCE

Attributes

command[R]
frequency[R]
name[R]

Public Class Methods

new(name, attrs = {}) click to toggle source
# File lib/rake/migrations/task.rb, line 8
def initialize(name, attrs = {})
  @name      = name
  @command   = attrs[:command]
  @frequency = attrs[:frequency] || RUN_ONCE
end

Public Instance Methods

==(other) click to toggle source
# File lib/rake/migrations/task.rb, line 31
def ==(other)
  name == other.name
end
Also aliased as: equal?
equal?(other)
Alias for: ==
run_every_time?() click to toggle source
# File lib/rake/migrations/task.rb, line 14
def run_every_time?
  frequency == RUN_EVERY_TIME
end
run_once?() click to toggle source
# File lib/rake/migrations/task.rb, line 18
def run_once?
  frequency == RUN_ONCE
end
to_h() click to toggle source
# File lib/rake/migrations/task.rb, line 22
def to_h
  {
    name => {
      command: command,
      frequency: frequency
    }
  }
end