Class: Ivy::Target

Inherits:
Object
  • Object
show all
Defined in:
lib/ivy/target.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ant) ⇒ Target

Returns a new instance of Target.



21
22
23
# File 'lib/ivy/target.rb', line 21

def initialize(ant)
  @ant = ant
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



19
20
21
# File 'lib/ivy/target.rb', line 19

def params
  @params
end

Instance Method Details

#execute(*params) ⇒ Object

Executes this ivy target with given parameters returning a result where appropriate



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ivy/target.rb', line 26

def execute(*params)
  @params = {}
  params.pop.each { |key, value| @params[key] = value } if Hash === params.last
  params.each { |key| @params[key] = true }

  validate
  before_hook
  execute_ivy
  create_return_values
ensure
  after_hook
end