Sha256: b9649eb7d26996734efcbbfb9fd5ee2d9d8fbe559e3c81b38884407b12d7a4b3

Contents?: true

Size: 571 Bytes

Versions: 1

Compression:

Stored size: 571 Bytes

Contents

require "validate_url"

module MicroService	
	class Client < ::ActiveRecord::Base
		module ClassMethods
			def self.extended(base)
				base.send(:attr_accessor, :configuration)
				base.validates :secret, :presence => true
				base.validates :install_url, :presence => true, url: true
				base.after_initialize :initialize_secret
				base.after_create :after_create_notify_client_service
			end

			def configuration
				@configuration
			end

			def configure
				@configuration ||= MicroService::Client::Configuration.new
				yield(@configuration)
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
micro_service-client-0.0.1 lib/micro_service/client/class_methods.rb