Sha256: 14826a179e97dc07aea70d84764636b2e75e8c5f43de9f90a05eb6f44597fecb

Contents?: true

Size: 294 Bytes

Versions: 1

Compression:

Stored size: 294 Bytes

Contents

class JsonResponse

  attr_reader :status

  def initialize
    @status = false
  end

  def serialize
    { :status => @status }.to_json
  end

  def to_js(callback)
    "#{callback}(#{serialize});"
  end

  def positive
    @status = true
  end

  def negative
    @status = false
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
json_response-1.0.0 lib/json_response.rb