Class: StarkInfra::PixDirector
- Inherits:
-
StarkCore::Utils::SubResource
- Object
- StarkCore::Utils::SubResource
- StarkInfra::PixDirector
- Defined in:
- lib/pixdirector/pixdirector.rb
Overview
# PixDirector object
Mandatory data that must be registered within the Central Bank for emergency contact purposes.
When you initialize a PixDirector, the entity will not be automatically created in the Stark Infra API. The ‘create’ function sends the objects to the Stark Infra API and returns the created object.
## Parameters (required):
-
name [string]: name of the PixDirector. ex: ‘Edward Stark’.
-
tax_id [string]: tax ID (CPF) of the PixDirector. ex: ‘012.345.678-90’
-
phone [string]: phone of the PixDirector. ex: ‘+551198989898’
-
email [string]: email of the PixDirector. ex: ‘[email protected]’
-
password [string]: password of the PixDirector. ex: ‘12345678’
-
team_email [string]: team email. ex: ‘[email protected]’
-
team_phones [list of strings]: list of phones of the team. ex: [‘+5511988889999’, ‘+5511988889998’]
## Attributes (return-only):
-
status [string]: current PixDirector status. ex: ‘success’
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tax_id ⇒ Object
readonly
Returns the value of attribute tax_id.
-
#team_email ⇒ Object
readonly
Returns the value of attribute team_email.
-
#team_phones ⇒ Object
readonly
Returns the value of attribute team_phones.
Class Method Summary collapse
-
.create(director, user: nil) ⇒ Object
# Create a PixDirector.
- .resource ⇒ Object
Instance Method Summary collapse
-
#initialize(name:, tax_id:, phone:, email:, password:, team_email:, team_phones:, status: nil) ⇒ PixDirector
constructor
A new instance of PixDirector.
Constructor Details
#initialize(name:, tax_id:, phone:, email:, password:, team_email:, team_phones:, status: nil) ⇒ PixDirector
Returns a new instance of PixDirector.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/pixdirector/pixdirector.rb', line 29 def initialize(name:, tax_id:, phone:, email:, password:, team_email:, team_phones:, status: nil) @name = name @tax_id = tax_id @phone = phone @email = email @password = password @team_email = team_email @team_phones = team_phones @status = status end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
28 29 30 |
# File 'lib/pixdirector/pixdirector.rb', line 28 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/pixdirector/pixdirector.rb', line 28 def name @name end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
28 29 30 |
# File 'lib/pixdirector/pixdirector.rb', line 28 def password @password end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
28 29 30 |
# File 'lib/pixdirector/pixdirector.rb', line 28 def phone @phone end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
28 29 30 |
# File 'lib/pixdirector/pixdirector.rb', line 28 def status @status end |
#tax_id ⇒ Object (readonly)
Returns the value of attribute tax_id.
28 29 30 |
# File 'lib/pixdirector/pixdirector.rb', line 28 def tax_id @tax_id end |
#team_email ⇒ Object (readonly)
Returns the value of attribute team_email.
28 29 30 |
# File 'lib/pixdirector/pixdirector.rb', line 28 def team_email @team_email end |
#team_phones ⇒ Object (readonly)
Returns the value of attribute team_phones.
28 29 30 |
# File 'lib/pixdirector/pixdirector.rb', line 28 def team_phones @team_phones end |
Class Method Details
.create(director, user: nil) ⇒ Object
# Create a PixDirector
Send a PixDirector object for creation in the Stark Infra API
## Parameters (required):
-
director [PixDirector object]: PixDirector object to be created in the API. ex: PixDirector.new()
## Parameters (optional):
-
user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
## Return:
-
PixDirector object with updated attributes.
52 53 54 |
# File 'lib/pixdirector/pixdirector.rb', line 52 def self.create(director, user: nil) StarkInfra::Utils::Rest.post_single(entity: director, user: user, **resource) end |
.resource ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/pixdirector/pixdirector.rb', line 56 def self.resource { resource_name: 'PixDirector', resource_maker: proc { |json| PixDirector.new( name: json['name'], tax_id: json['tax_id'], phone: json['phone'], email: json['email'], password: json['password'], team_email: json['team_email'], team_phones: json['team_phones'], status: json['status'] ) } } end |