class PortaText::Command::Api::DidSearch

The dids/search endpoint. github.com/PortaText/docs/wiki/REST-API#api_dids_search

Author

Marcelo Gornstein (marcelog@portatext.com)

Copyright

Copyright © 2015 PortaText

License

Apache-2.0

Public Instance Methods

body(_method) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 47
def body(_method)
  ''
end
contains(pattern) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 43
def contains(pattern)
  with_pattern 'anywhere', pattern
end
endpoint(_method) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 51
def endpoint(_method)
  qs = URI.encode_www_form @args
  "dids/search?#{qs}"
end
ends_with(pattern) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 39
def ends_with(pattern)
  with_pattern 'ends_with', pattern
end
for_country(iso_code) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 11
def for_country(iso_code)
  set :country, iso_code
end
local() click to toggle source
# File lib/portatext/command/api/did_search.rb, line 19
def local
  type 'local'
end
mobile() click to toggle source
# File lib/portatext/command/api/did_search.rb, line 27
def mobile
  type 'mobile'
end
national() click to toggle source
# File lib/portatext/command/api/did_search.rb, line 23
def national
  type 'national'
end
page(page) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 31
def page(page)
  set :page, page
end
starts_with(pattern) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 35
def starts_with(pattern)
  with_pattern 'starts_with', pattern
end
toll_free() click to toggle source
# File lib/portatext/command/api/did_search.rb, line 15
def toll_free
  type 'toll_free'
end

Private Instance Methods

type(type) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 58
def type(type)
  set :type, type
end
with_pattern(type, pattern) click to toggle source
# File lib/portatext/command/api/did_search.rb, line 62
def with_pattern(type, pattern)
  set :where_pattern, type
  set :pattern, pattern
end