Class: Xommelier::DS::CryptoBinary
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.from_xommelier(value) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/xommelier/ds.rb', line 20
def self.from_xommelier(value)
return unless value
case value
when %r(\A[a-zA-Z0-9+/]={0,2}\Z)
new Base64.decode64(value)
when String
new value
else
new value.to_s
end
end
|
Instance Method Details
32
33
34
|
# File 'lib/xommelier/ds.rb', line 32
def inspect
%(#<#{self.class.name} "#{self}">)
end
|
36
37
38
|
# File 'lib/xommelier/ds.rb', line 36
def raw
__getobj__
end
|
#to_xommelier ⇒ Object
42
43
44
|
# File 'lib/xommelier/ds.rb', line 42
def to_xommelier
Base64.encode64(raw)
end
|