Class: RecordStore::Provider::NS1
- Inherits:
-
RecordStore::Provider
- Object
- RecordStore::Provider
- RecordStore::Provider::NS1
- Defined in:
- lib/record_store/provider/ns1.rb,
lib/record_store/provider/ns1/client.rb
Defined Under Namespace
Classes: ApiAnswer, Client, Error
Class Method Summary collapse
- .client ⇒ Object
- .record_types ⇒ Object
-
.retrieve_current_records(zone:, stdout: $stdout) ⇒ Object
Downloads all the records from the provider.
-
.zones ⇒ Object
Returns an array of the zones managed by provider as strings.
Methods inherited from RecordStore::Provider
apply_changeset, build_zone, freezable?, provider_for, supports_alias?, thawable?, to_s
Class Method Details
.client ⇒ Object
48 49 50 |
# File 'lib/record_store/provider/ns1.rb', line 48 def client Provider::NS1::Client.new(api_key: secrets['api_key']) end |
.record_types ⇒ Object
44 45 46 |
# File 'lib/record_store/provider/ns1.rb', line 44 def record_types super | Set.new(%w(PTR)) end |
.retrieve_current_records(zone:, stdout: $stdout) ⇒ Object
Downloads all the records from the provider.
Returns: an array of ‘Record` for each record in the provider’s zone
55 56 57 58 59 |
# File 'lib/record_store/provider/ns1.rb', line 55 def retrieve_current_records(zone:, stdout: $stdout) # rubocop:disable Lint/UnusedMethodArgument records_for_zone(zone) .flat_map { |short_record| build_from_api(short_record) } .compact end |
.zones ⇒ Object
Returns an array of the zones managed by provider as strings
62 63 64 |
# File 'lib/record_store/provider/ns1.rb', line 62 def zones client.zones.map { |zone| zone['zone'] } end |