Class: GetVersion::Executable

Inherits:
Object
  • Object
show all
Defined in:
lib/getversion/executable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#blockObject (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