Class: Relaton::Itu::HitCollection

Inherits:
Core::HitCollection
  • Object
show all
Defined in:
lib/relaton/itu/hit_collection.rb

Overview

Page of hit collection.

Constant Summary collapse

DOMAIN =
"https://www.itu.int"
GH_ITU_R =
"https://raw.githubusercontent.com/relaton/relaton-data-itu-r/refs/heads/data-v2/"

Instance Method Summary collapse

Instance Method Details

#agentObject



24
25
26
# File 'lib/relaton/itu/hit_collection.rb', line 24

def agent
  @agent ||= Mechanize.new.tap { |agent| agent.user_agent_alias = "Mac Safari" }
end

#searchObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/relaton/itu/hit_collection.rb', line 12

def search
  case ref.to_ref
  when /^(ITU-T|ITU-R\sRR)/
    request_search
  when /^ITU-R\s/
    request_document
  end
rescue Mechanize::ResponseCodeError, SocketError, Timeout::Error, Errno::ECONNRESET,
        EOFError, Net::ProtocolError, OpenSSL::SSL::SSLError => e
  raise Relaton::RequestError, "Could not access #{ref.to_ref}: #{e.message}"
end