Class: Pendulum::Command::Apply::Schedule

Inherits:
Object
  • Object
show all
Defined in:
lib/pendulum/command/apply/schedule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, from, to, dry_run = false, force = false, color = false) ⇒ Schedule

Returns a new instance of Schedule.



7
8
9
10
11
12
13
14
# File 'lib/pendulum/command/apply/schedule.rb', line 7

def initialize(client, from, to, dry_run=false, force=false, color=false)
  self.client  = client
  self.from    = from
  self.to      = to
  self.dry_run = dry_run
  self.force   = force
  self.color   = color
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



6
7
8
# File 'lib/pendulum/command/apply/schedule.rb', line 6

def client
  @client
end

#colorObject

Returns the value of attribute color.



6
7
8
# File 'lib/pendulum/command/apply/schedule.rb', line 6

def color
  @color
end

#dry_runObject

Returns the value of attribute dry_run.



6
7
8
# File 'lib/pendulum/command/apply/schedule.rb', line 6

def dry_run
  @dry_run
end

#forceObject

Returns the value of attribute force.



6
7
8
# File 'lib/pendulum/command/apply/schedule.rb', line 6

def force
  @force
end

#fromObject

Returns the value of attribute from.



6
7
8
# File 'lib/pendulum/command/apply/schedule.rb', line 6

def from
  @from
end

#toObject

Returns the value of attribute to.



6
7
8
# File 'lib/pendulum/command/apply/schedule.rb', line 6

def to
  @to
end

Instance Method Details

#applyObject



16
17
18
19
20
21
22
# File 'lib/pendulum/command/apply/schedule.rb', line 16

def apply
  case
  when will_create? then create
  when will_update? then update
  when will_delete? then delete
  end
end