Class: Ciphr::Functions::Simple::Repack
Instance Attribute Summary
Attributes inherited from Function
#args, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Function
aligned, inherited, #initialize, invertable?, #prepend, #read
Class Method Details
.params ⇒ Object
50
51
52
|
# File 'lib/ciphr/functions/simple.rb', line 50
def self.params
[:input,:ch1,:ch2]
end
|
.variants ⇒ Object
46
47
48
|
# File 'lib/ciphr/functions/simple.rb', line 46
def self.variants
[ [['repack'], {}] ]
end
|
Instance Method Details
#apply ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/ciphr/functions/simple.rb', line 30
def apply
input, ch1in, ch2in = @args
content, ch1, ch2 = [input.read, ch1in.read, ch2in.read]
Proc.new do
if content
begin
content.unpack(ch1).pack(ch2)
ensure
content = nil
end
else
nil
end
end
end
|