Sha256: 94943663fe28fb6a0f4f59898f830ba807fbf0f8fff0e25a4b7c8d66057e63e6

Contents?: true

Size: 367 Bytes

Versions: 1

Compression:

Stored size: 367 Bytes

Contents

module Flydata
  module Api
    class Base
      def initialize(api_client)
        @client = api_client
      end
      def list(params={})
        JSON.parse(@client.get(@url_path))
      end
      def create(params={})
        params.each {|k, v| @url_path.gsub!(/:#{k}/, v.to_s)}
        @client.post(@url_path, @model_name => params)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flydata-0.0.1.2011101801 lib/flydata/api/base.rb