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.
14 15 16 17 18 19 20 |
# File 'lib/snov/domain_search.rb', line 14 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.
12 13 14 |
# File 'lib/snov/domain_search.rb', line 12 def client @client end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
12 13 14 |
# File 'lib/snov/domain_search.rb', line 12 def domain @domain end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
12 13 14 |
# File 'lib/snov/domain_search.rb', line 12 def limit @limit end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/snov/domain_search.rb', line 12 def type @type end |
Instance Method Details
#company_name ⇒ Object
42 43 44 |
# File 'lib/snov/domain_search.rb', line 42 def company_name raw_result.company_name end |
#each(&block) ⇒ Object
22 23 24 |
# File 'lib/snov/domain_search.rb', line 22 def each(&block) emails.each(&block) end |
#emails ⇒ Object
46 47 48 |
# File 'lib/snov/domain_search.rb', line 46 def emails raw_result.emails end |
#last_id ⇒ Object
38 39 40 |
# File 'lib/snov/domain_search.rb', line 38 def last_id raw_result.last_id end |
#raw_result ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/snov/domain_search.rb', line 50 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
34 35 36 |
# File 'lib/snov/domain_search.rb', line 34 def result raw_result.result end |
#success ⇒ Object
26 27 28 |
# File 'lib/snov/domain_search.rb', line 26 def success raw_result.success end |
#to_h ⇒ Object
58 59 60 |
# File 'lib/snov/domain_search.rb', line 58 def to_h raw_result.to_h end |
#webmail ⇒ Object
30 31 32 |
# File 'lib/snov/domain_search.rb', line 30 def webmail raw_result.webmail end |