Class: Ciphr::Functions::Bitwise::UnaryBitwise
- Inherits:
-
Function
- Object
- Function
- Ciphr::Functions::Bitwise::UnaryBitwise
show all
- Defined in:
- lib/ciphr/functions/bitwise.rb
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
76
77
78
|
# File 'lib/ciphr/functions/bitwise.rb', line 76
def self.params
[:input]
end
|
.variants ⇒ Object
72
73
74
|
# File 'lib/ciphr/functions/bitwise.rb', line 72
def self.variants
[ ['not', {}] ]
end
|
Instance Method Details
#apply ⇒ Object
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/ciphr/functions/bitwise.rb', line 60
def apply
input = @args[0]
Proc.new do
inchunk = input.read(1)
if inchunk
inchunk.bytes.map{|b| b = ~b }.pack("c*")
else
nil
end
end
end
|