You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::Partitions::Partition

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-partitions/lib/aws-partitions/partition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString (readonly)

Returns The partition name, e.g. "aws", "aws-cn", "aws-us-gov".

Returns:

  • (String)

    The partition name, e.g. "aws", "aws-cn", "aws-us-gov".



16
17
18
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 16

def name
  @name
end

Instance Method Details

#region(region_name) ⇒ Region

Parameters:

  • region_name (String)

    The name of the region, e.g. "us-east-1".

Returns:

Raises:

  • (ArgumentError)

    Raises ArgumentError for unknown region name.



21
22
23
24
25
26
27
28
29
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 21

def region(region_name)
  if @regions.key?(region_name)
    @regions[region_name]
  else
    msg = "invalid region name #{region_name.inspect}; valid region "
    msg << "names include %s" % [@regions.keys.join(', ')]
    raise ArgumentError, msg
  end
end

#regionsArray<Region>

Returns:



32
33
34
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 32

def regions
  @regions.values
end

#service(service_name) ⇒ Service

Parameters:

  • service_name (String)

    The service module name.

Returns:

Raises:

  • (ArgumentError)

    Raises ArgumentError for unknown service name.



39
40
41
42
43
44
45
46
47
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 39

def service(service_name)
  if @services.key?(service_name)
    @services[service_name]
  else
    msg = "invalid service name #{service_name.inspect}; valid service "
    msg << "names include %s" % [@services.keys.join(', ')]
    raise ArgumentError, msg
  end
end

#servicesArray<Service>

Returns:



50
51
52
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 50

def services
  @services.values
end