Sha256: 2d524177a75320c00c3294714c02b75c95c170ebe9a7e23bbf2c1535a8eac666

Contents?: true

Size: 462 Bytes

Versions: 2

Compression:

Stored size: 462 Bytes

Contents

require 'weary'
require 'json'

DEVELOPMENT_DOMAIN = "http://localhost:3000"

module APIClient
  class Answer < Weary::Client
    domain DEVELOPMENT_DOMAIN if Rails.env.development?
    domain PRODUCTION_DOMAIN  if Rails.env.production?
    
    get :all, "/answers.json"
    get :find, "/answers/{id}.json"
    
    post :create, "/answers.json" do |resource|
      resource.optional :need_to_know
      resource.required :text, :in_language
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
answers-core-0.0.0.2 lib/api_client.rb
answers-core-0.0.0 lib/api_client.rb