Sha256: 33a284f420512b53ee7e6061bef2135ade13653001bb6dc22c30d2e873e8a5ba

Contents?: true

Size: 390 Bytes

Versions: 1

Compression:

Stored size: 390 Bytes

Contents

module Quintly
  class Configuration
    ATTRIBUTES = [
      :username,
      :password
    ]

    ATTRIBUTES.each { |attribute| attr_accessor attribute }

    def initialize
      yield self if block_given?
    end

    def valid?
      ATTRIBUTES.each do |attribute|
        return false if self.send(attribute).nil? || self.send(attribute).empty?
      end
      true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quintly-0.1.0 lib/quintly/configuration.rb