Class: Podage::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/podage/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.



35
36
37
38
39
40
41
42
43
# File 'lib/podage/cli/option.rb', line 35

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.



30
31
32
# File 'lib/podage/cli/option.rb', line 30

def description
  @description
end

#has_argumentObject

Returns the value of attribute has_argument.



31
32
33
# File 'lib/podage/cli/option.rb', line 31

def has_argument
  @has_argument
end

#nameObject

Returns the value of attribute name.



28
29
30
# File 'lib/podage/cli/option.rb', line 28

def name
  @name
end

#short_cutObject

Returns the value of attribute short_cut.



29
30
31
# File 'lib/podage/cli/option.rb', line 29

def short_cut
  @short_cut
end

Instance Method Details

#executeObject



45
46
47
48
49
# File 'lib/podage/cli/option.rb', line 45

def execute

  @block.call

end