Class: Phoenx::Cli::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/phoenx/cli/option.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, short_cut, description, has_argument, &block) ⇒ Option

Returns a new instance of Option.



14
15
16
17
18
19
20
# File 'lib/phoenx/cli/option.rb', line 14

def initialize(name, short_cut, description, has_argument, &block)
	@name = name
	@short_cut = short_cut
	@description = description
	@has_argument = has_argument
	@block = block	
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/phoenx/cli/option.rb', line 9

def description
  @description
end

#has_argumentObject

Returns the value of attribute has_argument.



10
11
12
# File 'lib/phoenx/cli/option.rb', line 10

def has_argument
  @has_argument
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/phoenx/cli/option.rb', line 7

def name
  @name
end

#short_cutObject

Returns the value of attribute short_cut.



8
9
10
# File 'lib/phoenx/cli/option.rb', line 8

def short_cut
  @short_cut
end

Instance Method Details

#executeObject



22
23
24
# File 'lib/phoenx/cli/option.rb', line 22

def execute
	@block.call
end