Class: NeverBounce::API::Request::JobsSearch

Inherits:
Base
  • Object
show all
Defined in:
lib/never_bounce/api/request/jobs_search.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

#job_idInteger

Returns:

  • (Integer)


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

def job_id
  @job_id
end

#pageInteger

Returns:

  • (Integer)


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

def page
  @page
end

#per_pageInteger

Returns:

  • (Integer)


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

def per_page
  @per_page
end

Class Method Details

.http_methodSymbol

Returns:

  • (Symbol)


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

def self.http_method
  :get
end

.pathString

Returns:

  • (String)


23
24
25
# File 'lib/never_bounce/api/request/jobs_search.rb', line 23

def self.path
  "jobs/search"
end

.response_klassResponse::JobsSearch



28
29
30
# File 'lib/never_bounce/api/request/jobs_search.rb', line 28

def self.response_klass
  Response::JobsSearch
end

Instance Method Details

#mode_hHash

Return a ready-to-merge mode attributes hash.

Returns:

  • (Hash)


34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/never_bounce/api/request/jobs_search.rb', line 34

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

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

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

#to_hHash

Returns:

  • (Hash)


51
52
53
54
55
# File 'lib/never_bounce/api/request/jobs_search.rb', line 51

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