class PortaText::Command::Api::Blacklist

The blacklist endpoint. github.com/PortaText/docs/wiki/REST-API#api_blacklist

Author

Marcelo Gornstein (marcelog@portatext.com)

Copyright

Copyright © 2015 PortaText

License

Apache-2.0

Public Instance Methods

csv(file) click to toggle source
# File lib/portatext/command/api/blacklist.rb, line 15
def csv(file)
  set :file, file
end
endpoint(_method) click to toggle source
# File lib/portatext/command/api/blacklist.rb, line 27
def endpoint(_method)
  return 'blacklist/contacts' unless @args[:accept_file].nil?
  return 'blacklist/contacts' unless @args[:file].nil?
  page = @args[:page]
  @args.delete :page
  page ||= 1
  return "blacklist?page=#{page}" if @args[:number].nil?
  number = @args[:number]
  @args.delete :number
  "blacklist/#{number}"
end
number(number) click to toggle source
# File lib/portatext/command/api/blacklist.rb, line 11
def number(number)
  set :number, number
end
page(page) click to toggle source
# File lib/portatext/command/api/blacklist.rb, line 23
def page(page)
  set :page, page
end
save_to(file) click to toggle source
# File lib/portatext/command/api/blacklist.rb, line 19
def save_to(file)
  set :accept_file, file
end