Sha256: 1cbb9194bfac3efd4128370b41625832a3fae8f9128e6e7b0af46a1960ffb127

Contents?: true

Size: 421 Bytes

Versions: 2

Compression:

Stored size: 421 Bytes

Contents

module Materialize
  class Response

    attr_reader :message, :status, :options

    def initialize(options)
      @message = options['message']
      @status  = options['status'].to_sym
      @options = options
    end

    def ok?
      status == :ok
    end

    # This is used to look up ids -> e.g. patient_id, phase_id, etc.
    def method_missing(message)
      options.send(:[], message.to_s)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
materialize-0.4.5 lib/materialize/response.rb
materialize-0.4.4 lib/materialize/response.rb