Sha256: 16561e32f1c9d0966933fe38b119b56d96c52d54fe4583e3d04b2f04d1758499

Contents?: true

Size: 463 Bytes

Versions: 3

Compression:

Stored size: 463 Bytes

Contents

module Quintly
  class Configuration
    ATTRIBUTES = [
      :start_time,
      :end_time,
      :interval,
      :profile_ids,
      :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

3 entries across 3 versions & 1 rubygems

Version Path
quintly-0.1.3 lib/quintly/configuration.rb
quintly-0.1.2 lib/quintly/configuration.rb
quintly-0.1.1 lib/quintly/configuration.rb