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



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

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)


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

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>)


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

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



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

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



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

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