Class: RelatonItu::HitCollection
- Inherits:
-
RelatonBib::HitCollection
- Object
- RelatonBib::HitCollection
- RelatonItu::HitCollection
- 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/main/"
- INDEX_FILE =
"index-v1.yaml"
Instance Attribute Summary collapse
- #agent ⇒ Mechanize readonly
- #gi_imp ⇒ TrueClass, FalseClass readonly
Instance Method Summary collapse
-
#initialize(refid) ⇒ HitCollection
constructor
A new instance of HitCollection.
Constructor Details
#initialize(refid) ⇒ HitCollection
Returns a new instance of HitCollection.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/relaton_itu/hit_collection.rb', line 23 def initialize(refid) # rubocop:todo Metrics/MethodLength @refid = refid text = refid.to_ref.sub(/(?<=\.)Imp\s?(?=\d)/, "") super text, refid.year @agent = Mechanize.new agent.user_agent_alias = "Mac Safari" @gi_imp = /\.Imp\d/.match?(refid.to_s) @array = [] case refid.to_ref when /^(ITU-T|ITU-R\sRR)/ request_search when /^ITU-R\s/ request_document end end |
Instance Attribute Details
#agent ⇒ Mechanize (readonly)
18 19 20 |
# File 'lib/relaton_itu/hit_collection.rb', line 18 def agent @agent end |
#gi_imp ⇒ TrueClass, FalseClass (readonly)
15 16 17 |
# File 'lib/relaton_itu/hit_collection.rb', line 15 def gi_imp @gi_imp end |