Class: KandyWrapper::Domain
- Inherits:
-
Object
- Object
- KandyWrapper::Domain
- Includes:
- HTTParty
- Defined in:
- lib/kandy_wrapper/domain.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#domain_name ⇒ Object
Returns the value of attribute domain_name.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
Instance Method Summary collapse
- #create_domain(domain_name:, project_name:) ⇒ Object
-
#initialize(account) ⇒ Domain
constructor
A new instance of Domain.
Constructor Details
#initialize(account) ⇒ Domain
Returns a new instance of Domain.
9 10 11 12 13 14 |
# File 'lib/kandy_wrapper/domain.rb', line 9 def initialize(account) @account = account @access_token = account.access_token @domain_name = nil @project_name = nil end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
7 8 9 |
# File 'lib/kandy_wrapper/domain.rb', line 7 def access_token @access_token end |
#domain_name ⇒ Object
Returns the value of attribute domain_name.
7 8 9 |
# File 'lib/kandy_wrapper/domain.rb', line 7 def domain_name @domain_name end |
#project_name ⇒ Object
Returns the value of attribute project_name.
7 8 9 |
# File 'lib/kandy_wrapper/domain.rb', line 7 def project_name @project_name end |
Instance Method Details
#create_domain(domain_name:, project_name:) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/kandy_wrapper/domain.rb', line 16 def create_domain(domain_name:, project_name:) response = self.class.get("/accounts/domains", query: { key: access_token }, body: { domain_name: domain_name, project_name: project_name } ) self.domain_name = response["domain_name"] self.project_name = response["project_name"] end |