Class: Bs2Api::Entities::PixKey
- Inherits:
-
Object
- Object
- Bs2Api::Entities::PixKey
- Defined in:
- lib/bs2_api/entities/pix_key.rb
Constant Summary collapse
- TYPES =
{ cpf: 'CPF', cnpj: 'CNPJ', phone: 'PHONE', email: 'EMAIL', random: 'EVP' }.freeze
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ PixKey
constructor
A new instance of PixKey.
- #to_hash ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ PixKey
Returns a new instance of PixKey.
16 17 18 19 |
# File 'lib/bs2_api/entities/pix_key.rb', line 16 def initialize(args = {}) @key = args.fetch(:key, nil) @type = args.fetch(:type, 'CPF') end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/bs2_api/entities/pix_key.rb', line 6 def key @key end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/bs2_api/entities/pix_key.rb', line 6 def type @type end |
Class Method Details
Instance Method Details
#to_hash ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/bs2_api/entities/pix_key.rb', line 21 def to_hash ActiveSupport::HashWithIndifferentAccess.new( { "valor": @key, "tipo": @type } ) end |