Class: Aws::ClientStubs::Stub

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

Instance Method Summary collapse

Constructor Details

#initialize(output_shape) ⇒ Stub

Returns a new instance of Stub.

Parameters:

  • output_shape (Seahorse::Models::Shapes::Structure)

    This should be the output shape for an operation.


135
136
137
# File 'aws-sdk-core/lib/aws-sdk-core/client_stubs.rb', line 135

def initialize(output_shape)
  @shape = output_shape
end

Instance Method Details

#format(data = {}) ⇒ Object

Parameters:

  • data (Hash) (defaults to: {})

    An optional hash of data to format into the stubbed object.


141
142
143
144
145
146
147
148
# File 'aws-sdk-core/lib/aws-sdk-core/client_stubs.rb', line 141

def format(data = {})
  if @shape.nil?
    empty_stub(data)
  else
    validate_data(data)
    stub(@shape, data)
  end
end