class Sequel::Plugins::JsonSerializer::Literal

  1. lib/sequel/plugins/json_serializer.rb
Parent: JsonSerializer

Helper class used for making sure that cascading options for model associations works correctly. Cascaded options work by creating instances of this class, which take a literal JSON string and have to_json return it.

Methods

Public Class

  1. new

Public Instance

  1. to_json

Public Class methods

new (json)

Store the literal JSON to use

[show source]
# File lib/sequel/plugins/json_serializer.rb, line 126
def initialize(json)
  @json = json
end

Public Instance methods

to_json (*a)

Return the literal JSON to use

[show source]
# File lib/sequel/plugins/json_serializer.rb, line 131
def to_json(*a)
  @json
end