Sha256: 31d99718dc4a72a8b06d914332970b54b6099cdf8616d0624319bb7b961f5fae

Contents?: true

Size: 588 Bytes

Versions: 8

Compression:

Stored size: 588 Bytes

Contents

module PubliSci
  class Dataset
    class Configuration
      def self.defaults
        {
          interactive: false,
        }
      end

      defaults.keys.each{|k|
        default = defaults[k]
        define_method(k) do |input=nil|
          var = instance_variable_get :"@#{k}"
          if var
            var
          else
            instance_variable_set :"@#{k}", default
          end

          if input
            instance_variable_set :"@#{k}", input
          end

          instance_variable_get :"@#{k}"
        end

        attr_writer k
      }
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
publisci-0.1.6 lib/publisci/dataset/configuration.rb
publisci-0.1.5 lib/publisci/dataset/configuration.rb
publisci-0.1.4 lib/publisci/dataset/configuration.rb
publisci-0.1.3 lib/publisci/dataset/configuration.rb
publisci-0.1.2 lib/bio-publisci/dataset/configuration.rb
bio-publisci-0.1.0 lib/bio-publisci/dataset/configuration.rb
bio-publisci-0.0.8 lib/bio-publisci/dataset/configuration.rb
bio-publisci-0.0.7 lib/bio-publisci/dataset/configuration.rb