Class: ViewModel::Controller::CompiledJson

Inherits:
Object
  • Object
show all
Defined in:
lib/view_model/controller.rb

Overview

Wrap raw JSON in such a way that MultiJSON knows to pass it through untouched. Requires a MultiJson adapter other than ActiveSupport’s (modified) JsonGem.

Instance Method Summary collapse

Constructor Details

#initialize(s) ⇒ CompiledJson

Returns a new instance of CompiledJson.



133
134
135
# File 'lib/view_model/controller.rb', line 133

def initialize(s)
  @s = s
end

Instance Method Details

#to_json(*_args) ⇒ Object



137
138
139
# File 'lib/view_model/controller.rb', line 137

def to_json(*_args)
  @s
end

#to_sObject



141
142
143
# File 'lib/view_model/controller.rb', line 141

def to_s
  @s
end