Method: AWS::SimpleWorkflow::HistoryEvent::Attributes#to_h

Defined in:
lib/aws/simple_workflow/history_event.rb

#to_hHash

Returns all of the attributes in a hash with snaked_cased and symbolized keys.

Returns:

  • (Hash)

    Returns all of the attributes in a hash with snaked_cased and symbolized keys.



209
210
211
212
213
214
215
216
217
218
# File 'lib/aws/simple_workflow/history_event.rb', line 209

def to_h
  @data.inject({}) do |h,(key,value)|
    value = _cast(key,value)
    if value.is_a?(Array)
      value = value.map{|v| v.is_a?(Attributes) ? v.to_h : v }
    end
    h[_snake_case(key)] = value.is_a?(Attributes) ? value.to_h : value
    h
  end
end