Class: Pendulum::Command::Apply

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

Defined Under Namespace

Classes: ResultURL, Schedule

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Apply.



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

def initialize(client, from, to, dry_run=false, force=false, color=false)
  @schedules = matched_schedules(client, from, to, dry_run, force, color)
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/pendulum/command/apply.rb', line 3

def client
  @client
end

#dry_runObject

Returns the value of attribute dry_run.



3
4
5
# File 'lib/pendulum/command/apply.rb', line 3

def dry_run
  @dry_run
end

#forceObject

Returns the value of attribute force.



3
4
5
# File 'lib/pendulum/command/apply.rb', line 3

def force
  @force
end

Instance Method Details

#executeObject



9
10
11
# File 'lib/pendulum/command/apply.rb', line 9

def execute
  @schedules.each{|s| s.apply }
end