Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

Commit

Permalink
Better Class Names
Browse files Browse the repository at this point in the history
  • Loading branch information
rambleraptor authored and modular-magician committed Aug 6, 2018
1 parent 56cba7a commit be0256d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions lib/google/dns/property/managedzone_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ module Dns
module Data
# Base class for ResourceRefs
# Imports name from managed_zone
class ManagZoneNameRef
class ManagedZoneNameRef
include Comparable

def ==(other)
return false unless other.is_a? ManagZoneNameRef
return false unless other.is_a? ManagedZoneNameRef
return false if resource != other.resource
true
end
Expand All @@ -49,7 +49,7 @@ def <=>(other)

# A class to fetch the resource value from a referenced block
# Will return the value exported from a different Puppet resource
class ManagZoneNameRefCatalog < ManagZoneNameRef
class ManagedZoneNameRefCatalog < ManagedZoneNameRef
def initialize(title)
@title = title
end
Expand Down Expand Up @@ -78,7 +78,7 @@ def resource

# A class to manage a JSON blob from GCP API
# Will immediately return value from JSON blob without changes
class ManagZoneNameRefApi < ManagZoneNameRef
class ManagedZoneNameRefApi < ManagedZoneNameRef
attr_reader :resource

def initialize(resource)
Expand All @@ -97,21 +97,21 @@ def to_json(_arg = nil)

module Property
# A class to manage fetching name from a managed_zone
class ManagZoneNameRef < Puppet::Property
class ManagedZoneNameRef < Puppet::Property
# Used for catalog values
def unsafe_munge(value)
self.class.unsafe_munge(value)
end

def self.unsafe_munge(value)
return if value.nil?
Data::ManagZoneNameRefCatalog.new(value)
Data::ManagedZoneNameRefCatalog.new(value)
end

# Used for fetched JSON values
def self.api_munge(value)
return if value.nil?
Data::ManagZoneNameRefApi.new(value)
Data::ManagedZoneNameRefApi.new(value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/gdns_resource_record_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
desc 'The name of the ResourceRecordSet.'
end

newparam(:managed_zone, parent: Google::Dns::Property::ManagZoneNameRef) do
newparam(:managed_zone, parent: Google::Dns::Property::ManagedZoneNameRef) do
desc <<-DOC
Identifies the managed zone addressed by this request. Can be the managed zone name or id.
DOC
Expand Down

0 comments on commit be0256d

Please sign in to comment.