Class: Kontena::Cli::Models::Platform

Inherits:
Object
  • Object
show all
Includes:
CloudApiModel
Defined in:
lib/kontena/cli/models/platform.rb

Instance Attribute Summary

Attributes included from CloudApiModel

#api_data

Instance Method Summary collapse

Methods included from CloudApiModel

#id, #initialize, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Kontena::Cli::Models::CloudApiModel

Instance Method Details

#online?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/kontena/cli/models/platform.rb', line 11

def online?
  state.to_s == 'running'.freeze
end

#organizationObject



15
16
17
# File 'lib/kontena/cli/models/platform.rb', line 15

def organization
  @api_data.dig('relationships', 'organization', 'data', 'id')
end

#regionObject



7
8
9
# File 'lib/kontena/cli/models/platform.rb', line 7

def region
  @api_data.dig('relationships', 'region', 'data', 'id')
end

#to_pathObject



19
20
21
# File 'lib/kontena/cli/models/platform.rb', line 19

def to_path
  "#{self.organization}/#{self.name}"
end