class Nimbu::Endpoints::Channels

Public Instance Methods

add_webhook(*args) click to toggle source
# File lib/nimbu-api/endpoints/channels.rb, line 40
def add_webhook(*args)
  arguments(args, :required => [:channel_id])

  post_request("/channels/#{channel_id}/webhooks", arguments.params)
end
all(*args)
Alias for: list
entries(options={}, &block) click to toggle source
# File lib/nimbu-api/endpoints/channels.rb, line 8
def entries(options={}, &block)
  Nimbu::Builder.new('Channels::Entries', current_options.merge(options), &block)
end
find(*args)
Alias for: get
first(*args) click to toggle source
# File lib/nimbu-api/endpoints/channels.rb, line 21
def first(*args)
  arguments(args)

  get_request("/channels", arguments.params.merge(limit: 1)).first
end
get(*args) click to toggle source
# File lib/nimbu-api/endpoints/channels.rb, line 27
def get(*args)
  arguments(args, :required => [:channel_id])

  get_request("/channels/#{channel_id}", arguments.params)
end
Also aliased as: find
list(*args) { |el| ... } click to toggle source
# File lib/nimbu-api/endpoints/channels.rb, line 12
def list(*args)
  arguments(args)

  response = get_request("/channels", arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end
Also aliased as: all
poll_webhook(*args) click to toggle source
# File lib/nimbu-api/endpoints/channels.rb, line 46
def poll_webhook(*args)
  arguments(args, :required => [:channel_id])

  post_request("/channels/#{channel_id}/webhooks/poll", arguments.params)
end
webhooks(*args) click to toggle source
# File lib/nimbu-api/endpoints/channels.rb, line 34
def webhooks(*args)
  arguments(args, :required => [:channel_id])

  get_request("/channels/#{channel_id}/webhooks", arguments.params)
end