Class: Saro::Dat::DatPayload
- Inherits:
-
Object
- Object
- Saro::Dat::DatPayload
- Defined in:
- lib/saro/dat/dat.rb
Instance Attribute Summary collapse
-
#plain_bytes ⇒ Object
readonly
Returns the value of attribute plain_bytes.
-
#secure_bytes ⇒ Object
readonly
Returns the value of attribute secure_bytes.
Instance Method Summary collapse
-
#initialize(plain, secure) ⇒ DatPayload
constructor
A new instance of DatPayload.
- #plain ⇒ Object
- #secure ⇒ Object
- #to_s ⇒ Object
- #to_unsafe_string ⇒ Object
Constructor Details
#initialize(plain, secure) ⇒ DatPayload
Returns a new instance of DatPayload.
57 58 59 60 |
# File 'lib/saro/dat/dat.rb', line 57 def initialize(plain, secure) @plain_bytes = plain @secure_bytes = secure end |
Instance Attribute Details
#plain_bytes ⇒ Object (readonly)
Returns the value of attribute plain_bytes.
55 56 57 |
# File 'lib/saro/dat/dat.rb', line 55 def plain_bytes @plain_bytes end |
#secure_bytes ⇒ Object (readonly)
Returns the value of attribute secure_bytes.
55 56 57 |
# File 'lib/saro/dat/dat.rb', line 55 def secure_bytes @secure_bytes end |
Instance Method Details
#plain ⇒ Object
62 63 64 |
# File 'lib/saro/dat/dat.rb', line 62 def plain @plain_bytes.force_encoding('utf-8') end |
#secure ⇒ Object
66 67 68 |
# File 'lib/saro/dat/dat.rb', line 66 def secure @secure_bytes.force_encoding('utf-8') end |
#to_s ⇒ Object
70 71 72 |
# File 'lib/saro/dat/dat.rb', line 70 def to_s "#{Saro::Dat::Util.encode_base64_url_str(@plain_bytes)} #{Saro::Dat::Util.encode_base64_url_str(@secure_bytes)}" end |
#to_unsafe_string ⇒ Object
74 75 76 |
# File 'lib/saro/dat/dat.rb', line 74 def to_unsafe_string "#{plain} #{secure}" end |