Class: Aws::EmptyStructure

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Structure

from_hash, #orig_to_h

Class Method Details

.newObject



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

def self.new
  super([])
end

Instance Method Details

#==(other) ⇒ Object



8
9
10
# File '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 '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 '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 '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 '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 'lib/aws-sdk-core/empty_structure.rb', line 32

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

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
# File 'lib/aws-sdk-core/empty_structure.rb', line 37

def inspect
  '#<struct>'
end

#lengthObject



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

def length
  0
end

#membersObject



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

def members
  []
end

#pretty_print(q) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



42
43
44
# File 'lib/aws-sdk-core/empty_structure.rb', line 42

def pretty_print(q)
  q.text(inspect)
end

#select(&block) ⇒ Object



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

def select(&block)
  []
end

#sizeObject



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

def size
  0
end

#to_aObject



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

def to_a
  []
end

#to_hObject



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

def to_h
  {}
end

#valuesObject



70
71
72
# File '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 '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