Class: FluxTuna::Witness::AbstractWitness Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/witness/abstract_witness.rb

Overview

This class is abstract.

Defines the core FluxTuna::Witness class

Direct Known Subclasses

DirFileWitness

Instance Method Summary collapse

Constructor Details

#initialize(shatter, mutate, bind) ⇒ AbstractWitness

Default constructor. The names of the shatter, mutate and bind class to use for this FluxTuna::Witness must be passed in. These will be called in place of the the methods of this class when appropriate.



28
29
30
31
32
33
34
35
36
37
# File 'lib/witness/abstract_witness.rb', line 28

def initialize(shatter, mutate, bind)
  shatter_string = "Witness::Shatter::" + shatter.to_s
  @shatter = shatter_string.to_sym
  
  mutate_string = "Witness::Mutate::" + shatter.to_s
  @mutate = mutate_string.to_sym
  
  bind_string = "Witness::Bind::" + shatter.to_s
  @bind = bind_string.to_sym
end

Instance Method Details

#bindObject

Calls the named bind class to create the representation tree



50
51
52
# File 'lib/witness/abstract_witness.rb', line 50

def bind
  call_bind {}
end

#mutateObject

Calls the named bind class to mutate the representation



45
46
47
# File 'lib/witness/abstract_witness.rb', line 45

def mutate
  call_mutate {}
end

#shatterObject

Calls the named shatter class to break the original structure



40
41
42
# File 'lib/witness/abstract_witness.rb', line 40

def shatter
  call_shatter {}
end