Class: StarkInfra::PixDomain
- Inherits:
-
StarkCore::Utils::SubResource
- Object
- StarkCore::Utils::SubResource
- StarkInfra::PixDomain
- Defined in:
- lib/pixdomain/pixdomain.rb
Overview
# PixDomain object
The PixDomain object displays the domain name and the QR Code domain certificate of Pix participants. All certificates must be registered with the Central Bank.
## Attributes (return-only):
-
certificates [list of PixDomain::Certificate objects]: certificate information of the Pix participant.
-
name [string]: current active domain (URL) of the Pix participant.
Instance Attribute Summary collapse
-
#certificates ⇒ Object
readonly
Returns the value of attribute certificates.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
- ._parse_certificates(certificates) ⇒ Object
-
.query(user: nil) ⇒ Object
# Retrieve PixDomains.
- .resource ⇒ Object
Instance Method Summary collapse
-
#initialize(certificates: nil, name: nil) ⇒ PixDomain
constructor
A new instance of PixDomain.
Constructor Details
#initialize(certificates: nil, name: nil) ⇒ PixDomain
Returns a new instance of PixDomain.
19 20 21 22 |
# File 'lib/pixdomain/pixdomain.rb', line 19 def initialize(certificates: nil, name: nil) @certificates = certificates @name = name end |
Instance Attribute Details
#certificates ⇒ Object (readonly)
Returns the value of attribute certificates.
18 19 20 |
# File 'lib/pixdomain/pixdomain.rb', line 18 def certificates @certificates end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'lib/pixdomain/pixdomain.rb', line 18 def name @name end |
Class Method Details
._parse_certificates(certificates) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/pixdomain/pixdomain.rb', line 37 def self._parse_certificates(certificates) certificate_maker = StarkInfra::Certificate.resource[:resource_maker] parsed_certificates = [] certificates.each do |certificate| parsed_certificates << StarkCore::Utils::API.from_api_json(certificate_maker, certificate) end parsed_certificates end |
.query(user: nil) ⇒ Object
# Retrieve PixDomains
Receive a generator of PixDomain objects.
## Parameters (optional):
-
user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
## Return:
-
generator of PixDomain objects with updated attributes
33 34 35 |
# File 'lib/pixdomain/pixdomain.rb', line 33 def self.query(user: nil) StarkInfra::Utils::Rest.get_stream(user: user, **resource) end |