Class: PM::CodeKey

Inherits:
Object
  • Object
show all
Defined in:
lib/patchmaster/code_key.rb

Overview

A CodeKey holds a CodeChunk and remembers what key it is assigned to.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, code_chunk) ⇒ CodeKey

Returns a new instance of CodeKey.



8
9
10
# File 'lib/patchmaster/code_key.rb', line 8

def initialize(key, code_chunk)
  @key, @code_chunk = key, code_chunk
end

Instance Attribute Details

#code_chunkObject

Returns the value of attribute code_chunk.



6
7
8
# File 'lib/patchmaster/code_key.rb', line 6

def code_chunk
  @code_chunk
end

#keyObject

Returns the value of attribute key.



6
7
8
# File 'lib/patchmaster/code_key.rb', line 6

def key
  @key
end

Instance Method Details

#runObject



12
13
14
# File 'lib/patchmaster/code_key.rb', line 12

def run
  @code_chunk.run
end