Class: Nzbn::Api::History
- Inherits:
-
Object
- Object
- Nzbn::Api::History
- Defined in:
- lib/nzbn/api/history.rb
Overview
History API - Access historical entity data
Instance Method Summary collapse
-
#addresses(nzbn:) ⇒ Array<Models::Address>
Get address history.
-
#entity_names(nzbn:) ⇒ Array<Hash>
Get entity name history.
-
#entity_statuses(nzbn:) ⇒ Array<Hash>
Get entity status history.
-
#get(nzbn:) ⇒ Hash
Get entity change history.
-
#hibernation_statuses(nzbn:) ⇒ Array<Hash>
Get hibernation status history.
-
#initialize(client) ⇒ History
constructor
A new instance of History.
-
#trading_areas(nzbn:) ⇒ Array<Hash>
Get trading area history.
-
#trading_names(nzbn:) ⇒ Array<Models::TradingName>
Get trading name history.
Constructor Details
#initialize(client) ⇒ History
Returns a new instance of History.
7 8 9 |
# File 'lib/nzbn/api/history.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#addresses(nzbn:) ⇒ Array<Models::Address>
Get address history
25 26 27 28 29 30 |
# File 'lib/nzbn/api/history.rb', line 25 def addresses(nzbn:) response = @client.get("/entities/#{nzbn}/history/addresses") return [] unless response.is_a?(Array) response.map { |addr| Models::Address.new(addr) } end |
#entity_names(nzbn:) ⇒ Array<Hash>
Get entity name history
37 38 39 |
# File 'lib/nzbn/api/history.rb', line 37 def entity_names(nzbn:) @client.get("/entities/#{nzbn}/history/entity-names") end |
#entity_statuses(nzbn:) ⇒ Array<Hash>
Get entity status history
67 68 69 |
# File 'lib/nzbn/api/history.rb', line 67 def entity_statuses(nzbn:) @client.get("/entities/#{nzbn}/history/entity-statuses") end |
#get(nzbn:) ⇒ Hash
Get entity change history
16 17 18 |
# File 'lib/nzbn/api/history.rb', line 16 def get(nzbn:) @client.get("/entities/#{nzbn}/history") end |
#hibernation_statuses(nzbn:) ⇒ Array<Hash>
Get hibernation status history
76 77 78 |
# File 'lib/nzbn/api/history.rb', line 76 def hibernation_statuses(nzbn:) @client.get("/entities/#{nzbn}/history/hibernation-statuses") end |
#trading_areas(nzbn:) ⇒ Array<Hash>
Get trading area history
58 59 60 |
# File 'lib/nzbn/api/history.rb', line 58 def trading_areas(nzbn:) @client.get("/entities/#{nzbn}/history/trading-areas") end |
#trading_names(nzbn:) ⇒ Array<Models::TradingName>
Get trading name history
46 47 48 49 50 51 |
# File 'lib/nzbn/api/history.rb', line 46 def trading_names(nzbn:) response = @client.get("/entities/#{nzbn}/history/trading-names") return [] unless response.is_a?(Array) response.map { |tn| Models::TradingName.new(tn) } end |