Class: EverSdk::Crypto::ParamsOfAppEncryptionBox
- Inherits:
-
Object
- Object
- EverSdk::Crypto::ParamsOfAppEncryptionBox
- Defined in:
- lib/ever_sdk_client/crypto.rb
Constant Summary collapse
- TYPES =
%i[get_info encrypt decrypt]
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, **args) ⇒ ParamsOfAppEncryptionBox
constructor
A new instance of ParamsOfAppEncryptionBox.
- #to_h ⇒ Object
Constructor Details
#initialize(type:, **args) ⇒ ParamsOfAppEncryptionBox
Returns a new instance of ParamsOfAppEncryptionBox.
316 317 318 319 320 321 322 |
# File 'lib/ever_sdk_client/crypto.rb', line 316 def initialize(type:, **args) unless TYPES.include?(type) raise ArgumentError.new("type #{type} is unknown; known types: #{TYPES}") end @type = type @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
314 315 316 |
# File 'lib/ever_sdk_client/crypto.rb', line 314 def args @args end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
314 315 316 |
# File 'lib/ever_sdk_client/crypto.rb', line 314 def type @type end |
Instance Method Details
#to_h ⇒ Object
324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/ever_sdk_client/crypto.rb', line 324 def to_h hash = case type when :get_info {} when :encrypt, :decrypt { data: args[:data] } end { type: Helper.sym_to_capitalized_case_str(type) }.merge(hash) end |