Class: NeverBounce::API::Request::SingleCheck

Inherits:
Base
  • Object
show all
Defined in:
lib/never_bounce/api/request/single_check.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#api_key, #api_url, #headers, #user_agent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_curl, #to_httparty

Instance Attribute Details

#address_infoBoolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/never_bounce/api/request/single_check.rb', line 12

def address_info
  @address_info
end

#credits_infoBoolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/never_bounce/api/request/single_check.rb', line 15

def credits_info
  @credits_info
end

#emailString

Returns:

  • (String)


9
10
11
# File 'lib/never_bounce/api/request/single_check.rb', line 9

def email
  @email
end

#timeoutInteger

Returns:

  • (Integer)


18
19
20
# File 'lib/never_bounce/api/request/single_check.rb', line 18

def timeout
  @timeout
end

Class Method Details

.http_methodSymbol

Returns:

  • (Symbol)


21
22
23
# File 'lib/never_bounce/api/request/single_check.rb', line 21

def self.http_method
  :get
end

.pathString

Returns:

  • (String)


26
27
28
# File 'lib/never_bounce/api/request/single_check.rb', line 26

def self.path
  "single/check"
end

.response_klassResponse::SingleCheck



31
32
33
# File 'lib/never_bounce/api/request/single_check.rb', line 31

def self.response_klass
  Response::SingleCheck
end

Instance Method Details

#mode_hHash

Return a ready-to-merge mode attributes hash.

Returns:

  • (Hash)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/never_bounce/api/request/single_check.rb', line 37

def mode_h
  @mode_h ||= {}.tap do |_|
    unless (v = address_info).nil?
      _[:address_info] = v
    end

    unless (v = credits_info).nil?
      _[:credits_info] = v
    end

    unless (v = timeout).nil?
      _[:timeout] = v
    end
  end
end

#to_hHash

Returns:

  • (Hash)


54
55
56
57
58
59
# File 'lib/never_bounce/api/request/single_check.rb', line 54

def to_h
  {
    email: require_attr(:email),
    key: require_attr(:api_key),
  }.merge(mode_h)
end