Class: Almanack::SerializedTransformation

Inherits:
Object
  • Object
show all
Defined in:
lib/almanack/serialized_transformation.rb

Instance Method Summary collapse

Constructor Details

#initialize(subject) ⇒ SerializedTransformation

Returns a new instance of SerializedTransformation.



4
5
6
7
# File 'lib/almanack/serialized_transformation.rb', line 4

def initialize(subject)
  @subject = subject
  @transformations = {}
end

Instance Method Details

#applyObject



17
18
19
# File 'lib/almanack/serialized_transformation.rb', line 17

def apply
  recurse(cloned)
end

#key(&block) ⇒ Object



9
10
11
# File 'lib/almanack/serialized_transformation.rb', line 9

def key(&block)
  @transformations[:key] = block
end

#value(&block) ⇒ Object



13
14
15
# File 'lib/almanack/serialized_transformation.rb', line 13

def value(&block)
  @transformations[:value] = block
end