Sha256: 118a3446652f6f0e263fbeed150a2b66c7de5dc5c699115488684d5ceda2d4c0

Contents?: true

Size: 551 Bytes

Versions: 53

Compression:

Stored size: 551 Bytes

Contents

class Ey::Core::Client
  class Real
    def get_message(params={})
      id  = params["id"]
      url = params["url"]

      request(
        :path => "messages/#{id}",
        :url  => url
      )
    end
  end

  class Mock
    def get_message(params={})
      identity = resource_identity(params)

      if message = self.data[:messages].values.detect { |m| m["id"] == identity }
        response(
          :body   => {"message" => message},
          :status => 200,
        )
      else
        response(status: 404)
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
ey-core-3.6.4 lib/ey-core/requests/get_message.rb
ey-core-3.6.3 lib/ey-core/requests/get_message.rb
ey-core-3.6.1 lib/ey-core/requests/get_message.rb
groove-ey-core-3.6.3 lib/ey-core/requests/get_message.rb
groove-ey-core-3.6.2 lib/ey-core/requests/get_message.rb
groove-ey-core-3.6.1 lib/ey-core/requests/get_message.rb
ey-core-3.5.0 lib/ey-core/requests/get_message.rb
ey-core-3.4.4 lib/ey-core/requests/get_message.rb
ey-core-3.4.2 lib/ey-core/requests/get_message.rb
ey-core-3.4.1 lib/ey-core/requests/get_message.rb
ey-core-3.4.0 lib/ey-core/requests/get_message.rb
ey-core-3.3.1 lib/ey-core/requests/get_message.rb
ey-core-3.3.0 lib/ey-core/requests/get_message.rb
ey-core-3.2.6 lib/ey-core/requests/get_message.rb
ey-core-3.2.5 lib/ey-core/requests/get_message.rb
ey-core-3.2.4 lib/ey-core/requests/get_message.rb
ey-core-3.2.3 lib/ey-core/requests/get_message.rb
ey-core-3.2.2 lib/ey-core/requests/get_message.rb
ey-core-3.2.1 lib/ey-core/requests/get_message.rb
ey-core-3.2.0 lib/ey-core/requests/get_message.rb