Class: BatchlyApi::VpcDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/batchly_api/models/vpc_details.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



20
21
22
# File 'lib/batchly_api/models/vpc_details.rb', line 20

def method_missing (method_name)
  puts "there's no method called '#{method_name}'"
end

Instance Attribute Details

#regionString

Cloud Region in which the VPC is setup

Returns:

  • (String)


17
18
19
# File 'lib/batchly_api/models/vpc_details.rb', line 17

def region
  @region
end

#subnet_idsArray<String>

List of subnets within VPC which are assigned for batchly usage.

Minimum Subnets required for High Availability: 2

Returns:

  • (Array<String>)


13
14
15
# File 'lib/batchly_api/models/vpc_details.rb', line 13

def subnet_ids
  @subnet_ids
end

#vpc_idString

Identifier information of the VPC from cloud service

Returns:

  • (String)


8
9
10
# File 'lib/batchly_api/models/vpc_details.rb', line 8

def vpc_id
  @vpc_id
end

Instance Method Details

#key_mapObject

Defines the key map for json serialization



31
32
33
34
35
36
37
# File 'lib/batchly_api/models/vpc_details.rb', line 31

def key_map
  hash = {}
  hash['VpcId'] = self.vpc_id
  hash['SubnetIds'] = self.subnet_ids
  hash['Region'] = self.region
  hash
end

#to_jsonObject

Creates JSON of the curent object



25
26
27
28
# File 'lib/batchly_api/models/vpc_details.rb', line 25

def to_json
  hash = self.key_map()
  hash.to_json
end