Sha256: 7826cdc23acba4886c427ee2132a20d838cac363c5ee780ae2fd121e9014a02b

Contents?: true

Size: 502 Bytes

Versions: 2

Compression:

Stored size: 502 Bytes

Contents

module Board
  class Client::API

    def initialize(client)
      @client = client
    end

    def post(path, attributes = {})
      json = @client.post(path, attributes)

      if json.is_a?(Hash)
        Hashie::Mash.new(json)
      else
        json
      end
    end

    def get(path, attributes = {})
      json = @client.get(path, attributes)

      if json.is_a?(Array)
        json.map { |item| Hashie::Mash.new(item) }
      else
        Hashie::Mash.new(json)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
board-client-0.99.1 lib/board/client/api.rb
board-client-0.99.0 lib/board/client/api.rb