Class: ActiveZone::Provider Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/active_zone/provider.rb

Overview

This class is abstract.

Subclass in your provider gem.

The base class for Active Zone providers

Defined Under Namespace

Classes: Zone, ZoneCollection

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Object

This method is abstract.

Override in your provider subclass to configure & initialize your provider.

Examples:

Rails initializer

ActiveZone.provider = YourProvider.new(username:, password:, base_url: "dns.example.com")


8
9
10
11
12
13
14
15
16
17
18
# File 'lib/active_zone/provider.rb', line 8

class Provider
  # @return [Object<Zone>] Zone constant scoped under this Provider
  def Zone
    self.class.const_get(:Zone)
  end

  # @return [Object<ZoneCollection>] ZoneCollection constant scoped under this Provider
  def ZoneCollection
    self.class.const_get(:ZoneCollection)
  end
end

Instance Method Details

#ZoneObject<Zone>

Returns Zone constant scoped under this Provider.

Returns:

  • (Object<Zone>)

    Zone constant scoped under this Provider



10
11
12
# File 'lib/active_zone/provider.rb', line 10

def Zone
  self.class.const_get(:Zone)
end

#ZoneCollectionObject<ZoneCollection>

Returns ZoneCollection constant scoped under this Provider.

Returns:

  • (Object<ZoneCollection>)

    ZoneCollection constant scoped under this Provider



15
16
17
# File 'lib/active_zone/provider.rb', line 15

def ZoneCollection
  self.class.const_get(:ZoneCollection)
end