Class: Diogenes::DSL::Skill

Inherits:
Object
  • Object
show all
Defined in:
lib/diogenes/dsl/skill.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Skill

: (String, ?Proc) -> void



10
11
12
13
14
# File 'lib/diogenes/dsl/skill.rb', line 10

def initialize(name, &block)
  @name = name #: String
  instance_eval(&block) if block_given?
  validate!
end

Instance Attribute Details

#nameObject (readonly)

: String



7
8
9
# File 'lib/diogenes/dsl/skill.rb', line 7

def name
  @name
end

Instance Method Details

#command(value = nil) ⇒ Object

: (?String?) -> String?



17
18
19
20
# File 'lib/diogenes/dsl/skill.rb', line 17

def command(value = nil)
  @command = value unless value.nil?
  @command
end

#description(value = nil) ⇒ Object

: (?String?) -> String?



23
24
25
26
# File 'lib/diogenes/dsl/skill.rb', line 23

def description(value = nil)
  @description = value unless value.nil?
  @description
end

#prompt(value = nil) ⇒ Object

: (?String?) -> String?



29
30
31
32
# File 'lib/diogenes/dsl/skill.rb', line 29

def prompt(value = nil)
  @prompt = value unless value.nil?
  @prompt
end