Class: Billy::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/billygoat/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Task

Returns a new instance of Task.



7
8
9
# File 'lib/billygoat/task.rb', line 7

def initialize(config = {})
  config.each { |k,v| public_send("#{k}=",v) }
end

Instance Attribute Details

#skillObject

Returns the value of attribute skill.



5
6
7
# File 'lib/billygoat/task.rb', line 5

def skill
  @skill
end

Instance Method Details

#methodObject



23
24
25
26
# File 'lib/billygoat/task.rb', line 23

def method
  require skill.internal_location if skill.internal_location
  skill.module.instance_method(name)
end

#nameObject



11
12
13
# File 'lib/billygoat/task.rb', line 11

def name
  @name
end

#name=(value) ⇒ Object



15
16
17
# File 'lib/billygoat/task.rb', line 15

def name=(value)
  @name = value.to_s.downcase
end

#sourceObject



28
29
30
# File 'lib/billygoat/task.rb', line 28

def source
  self.method.source_location
end

#to_sObject



19
20
21
# File 'lib/billygoat/task.rb', line 19

def to_s
  name
end