Class: Snov::DomainSearch
- Inherits:
-
Object
- Object
- Snov::DomainSearch
- Includes:
- Enumerable
- Defined in:
- lib/snov/domain_search.rb
Constant Summary collapse
- Response =
Class.new(CamelSnakeStruct)
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #company_name ⇒ Object
- #each(&block) ⇒ Object
- #emails ⇒ Object
-
#initialize(domain:, type: 'all', limit: 10, last_id: 0, client: Snov.client) ⇒ DomainSearch
constructor
A new instance of DomainSearch.
- #last_id ⇒ Object
- #raw_result ⇒ Object
- #result ⇒ Object
- #success ⇒ Object
- #to_h ⇒ Object
- #webmail ⇒ Object
Constructor Details
#initialize(domain:, type: 'all', limit: 10, last_id: 0, client: Snov.client) ⇒ DomainSearch
Returns a new instance of DomainSearch.
13 14 15 16 17 18 19 |
# File 'lib/snov/domain_search.rb', line 13 def initialize(domain:, type: 'all', limit: 10, last_id: 0, client: Snov.client) @client = client @domain = domain @type = type @limit = limit @last_id = last_id end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
11 12 13 |
# File 'lib/snov/domain_search.rb', line 11 def client @client end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
11 12 13 |
# File 'lib/snov/domain_search.rb', line 11 def domain @domain end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
11 12 13 |
# File 'lib/snov/domain_search.rb', line 11 def limit @limit end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11 12 13 |
# File 'lib/snov/domain_search.rb', line 11 def type @type end |
Instance Method Details
#company_name ⇒ Object
41 42 43 |
# File 'lib/snov/domain_search.rb', line 41 def company_name raw_result.company_name end |
#each(&block) ⇒ Object
21 22 23 |
# File 'lib/snov/domain_search.rb', line 21 def each(&block) emails.each(&block) end |
#emails ⇒ Object
45 46 47 |
# File 'lib/snov/domain_search.rb', line 45 def emails raw_result.emails end |
#last_id ⇒ Object
37 38 39 |
# File 'lib/snov/domain_search.rb', line 37 def last_id raw_result.last_id end |
#raw_result ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/snov/domain_search.rb', line 49 def raw_result @raw_result ||= Response.new(client.get("/v2/domain-emails-with-info", 'lastId' => @last_id, 'limit' => @limit, 'type' => type.to_s, 'domain' => domain.to_s)) end |
#result ⇒ Object
33 34 35 |
# File 'lib/snov/domain_search.rb', line 33 def result raw_result.result end |
#success ⇒ Object
25 26 27 |
# File 'lib/snov/domain_search.rb', line 25 def success raw_result.success end |
#to_h ⇒ Object
57 58 59 |
# File 'lib/snov/domain_search.rb', line 57 def to_h raw_result.to_h end |
#webmail ⇒ Object
29 30 31 |
# File 'lib/snov/domain_search.rb', line 29 def webmail raw_result.webmail end |