Class: Aws::EmptyStructure

Inherits:
Structure
  • Object
show all
Defined in:
aws-sdk-core/lib/aws-sdk-core/empty_structure.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Structure

#orig_to_h

Class Method Details

.newObject


4
5
6
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 4

def self.new
  super([])
end

Instance Method Details

#==(other) ⇒ Object


8
9
10
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 8

def ==(other)
  other.is_a?(EmptyStructure)
end

#[](member_name) ⇒ Object

Raises:

  • (NameError)

12
13
14
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 12

def [](member_name)
  raise NameError, "no member '#{member_name}' in struct"
end

#[]=(member_name, value) ⇒ Object

Raises:

  • (NameError)

16
17
18
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 16

def []=(member_name, value)
  raise NameError, "no member '#{member_name}' in struct"
end

#each(&block) ⇒ Object


20
21
22
23
24
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 20

def each(&block)
  unless block_given?
    [].to_enum
  end
end

#each_pair(&block) ⇒ Object


26
27
28
29
30
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 26

def each_pair(&block)
  unless block_given?
    {}.to_enum
  end
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

32
33
34
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 32

def eql?(other)
  other.is_a?(EmptyStructure)
end

#lengthObject


46
47
48
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 46

def length
  0
end

#membersObject


50
51
52
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 50

def members
  []
end

#select(&block) ⇒ Object


54
55
56
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 54

def select(&block)
  []
end

#sizeObject


58
59
60
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 58

def size
  0
end

#to_aObject


62
63
64
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 62

def to_a
  []
end

#to_hObject


66
67
68
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 66

def to_h
  {}
end

#valuesObject


70
71
72
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 70

def values
  []
end

#values_at(*selector) ⇒ Object


74
75
76
77
78
79
80
81
# File 'aws-sdk-core/lib/aws-sdk-core/empty_structure.rb', line 74

def values_at(*selector)
  if selector.empty?
    []
  else
    offset = selector.first
    raise IndexError, "offset #{offset} too large for struct(size:0)"
  end
end