Class: Relish::Command::Dsl::Option
- Inherits:
-
Object
- Object
- Relish::Command::Dsl::Option
show all
- Includes:
- ContextClass
- Defined in:
- lib/relish/commands/dsl/option.rb
Instance Attribute Summary
Attributes included from ContextClass
#context_class
Class Method Summary
collapse
Instance Method Summary
collapse
#context_class_eval, #context_class_name, #initialize
Class Method Details
.names ⇒ Object
21
22
23
|
# File 'lib/relish/commands/dsl/option.rb', line 21
def self.names
@@names ||= []
end
|
Instance Method Details
#define(name, options = {}) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/relish/commands/dsl/option.rb', line 7
def define(name, options = {})
name = name.to_s
default_proc = options[:default] || Proc.new {}
context_class_eval do
define_method(name) do
cli_options[name] ||
local_options_file[name] ||
global_options_file[name] ||
instance_exec(&default_proc)
end
end
end
|