Class: ActiveSupport::JSON::Encoding::Encoder
- Defined in:
- lib/active_support/json/encoding.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #encode(value) ⇒ Object
- #escape(string) ⇒ Object
-
#initialize(options = nil) ⇒ Encoder
constructor
A new instance of Encoder.
Constructor Details
#initialize(options = nil) ⇒ Encoder
Returns a new instance of Encoder.
39 40 41 42 |
# File 'lib/active_support/json/encoding.rb', line 39 def initialize( = nil) @options = @seen = [] end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
37 38 39 |
# File 'lib/active_support/json/encoding.rb', line 37 def @options end |
Instance Method Details
#encode(value) ⇒ Object
44 45 46 47 48 |
# File 'lib/active_support/json/encoding.rb', line 44 def encode(value) check_for_circular_references(value) do value.as_json().encode_json(self) end end |