Module: CaRuby::JSON::Serializable

Includes:
Jinx::JSON::Serializable
Included in:
Resource
Defined in:
lib/caruby/json/serializable.rb

Instance Method Summary collapse

Instance Method Details

#to_json(state = nil) ⇒ String

This method disables lazy-loading before delegating to Jinx.

Parameters:

  • state (State, Hash, nil) (defaults to: nil)

    the JSON state or serialization options

Returns:

  • (String)

    the JSON representation of this Jinx::Resource



12
13
14
# File 'lib/caruby/json/serializable.rb', line 12

def to_json(state=nil)
  fetched? ? super : do_without_lazy_loader { super }
end