Sha256: 48a1788ba4714f92d57c367d57ea8bc929c2d125a871d72db51721e6aa7eec0e

Contents?: true

Size: 618 Bytes

Versions: 53

Compression:

Stored size: 618 Bytes

Contents

class Ey::Core::Client
  class Real
    def authorized_channel(path)
      request(
        :path   => "/channels",
        :params => {"channel" => {"path" => path}}
      )
    end
  end # Real

  class Mock
    def authorized_channel(path)
      if task = self.data[:tasks].values.find { |t| Addressable::URI.parse(t["read_channel"]).query_values["subscription"] == path }
        response(
          :body => {"task" => task},
        )
      else
        response(status: 404, :body => {"errors" => ["Couldn't find Awsm::Task with [channel_path: #{path}]"]})
      end
    end
  end # Mock
end # Ey::Core::Client

Version data entries

53 entries across 53 versions & 3 rubygems

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