Class: Struct

Inherits:
Object show all
Defined in:
lib/active_support/core_ext/struct.rb,
lib/active_support/core_ext/object/json.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Object


56
57
58
# File 'lib/active_support/core_ext/object/json.rb', line 56

def as_json(options = nil)
  Hash[members.zip(values)].as_json(options)
end

#to_hObject


3
4
5
# File 'lib/active_support/core_ext/struct.rb', line 3

def to_h
  Hash[members.zip(values)]
end