Class: GetVersion::Executable
- Inherits:
-
Object
- Object
- GetVersion::Executable
- Defined in:
- lib/getversion/executable.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(&block) ⇒ Executable
constructor
A new instance of Executable.
- #version(path) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Executable
Returns a new instance of Executable.
9 10 11 |
# File 'lib/getversion/executable.rb', line 9 def initialize(&block) @block = block || Proc.new {} end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
7 8 9 |
# File 'lib/getversion/executable.rb', line 7 def block @block end |
Class Method Details
.version(path, &block) ⇒ Object
17 18 19 |
# File 'lib/getversion/executable.rb', line 17 def self.version(path, &block) Executable.new(&block).version(path) end |
Instance Method Details
#version(path) ⇒ Object
13 14 15 |
# File 'lib/getversion/executable.rb', line 13 def version(path) ExecutionContext.execute path, &@block end |