Class: KandyWrapper::Domain

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/kandy_wrapper/domain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = 
  @access_token = .access_token
  @domain_name = nil
  @project_name = nil
end

Instance Attribute Details

#access_tokenObject

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_nameObject

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_nameObject

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