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"
Instance Attribute Summary collapse
- #gi_imp ⇒ TrueClass, FalseClass readonly
Instance Method Summary collapse
-
#initialize(ref, year = nil) ⇒ HitCollection
constructor
A new instance of HitCollection.
Constructor Details
#initialize(ref, year = nil) ⇒ HitCollection
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/relaton_itu/hit_collection.rb', line 17 def initialize(ref, year = nil) text = ref.sub /(?<=\.)Imp\s?(?=\d)/, "" super text, year @gi_imp = /\.Imp\d/.match?(ref) uri = URI "#{DOMAIN}/net4/ITU-T/search/GlobalSearch/Search" data = { json: params.to_json } resp = Net::HTTP.post(uri, data.to_json, "Content-Type" => "application/json") @array = hits JSON.parse(resp.body) end |
Instance Attribute Details
#gi_imp ⇒ TrueClass, FalseClass (readonly)
13 14 15 |
# File 'lib/relaton_itu/hit_collection.rb', line 13 def gi_imp @gi_imp end |