Class: Tanker::Padding

Inherits:
Object
  • Object
show all
Defined in:
lib/tanker/encryption_options.rb

Constant Summary collapse

AUTO =
new 0
OFF =
new 1

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(native_value) ⇒ Padding

Returns a new instance of Padding.



43
44
45
46
# File 'lib/tanker/encryption_options.rb', line 43

def initialize(native_value)
  super()
  @native_value = native_value
end

Instance Attribute Details

#native_valueObject (readonly)

Returns the value of attribute native_value.



41
42
43
# File 'lib/tanker/encryption_options.rb', line 41

def native_value
  @native_value
end

Class Method Details

.step(value) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/tanker/encryption_options.rb', line 51

def self.step(value)
  unless value.is_a?(Integer)
    raise TypeError,
          "expected step to be an Integer >= 2, but got a #{value.class}"
  end
  unless value >= 2
    raise ArgumentError,
          "expected step to be an Integer >= 2, but got #{value}"
  end

  new(value)
end