Sha256: 99c42b7128660ba35633a339a0458f6698cf171e04adcb2dd8b5bf39fa53b0f7
Contents?: true
Size: 701 Bytes
Versions: 8
Compression:
Stored size: 701 Bytes
Contents
module PubliSci module DSL class Configuration def self.defaults { output: :generate_n3, abbreviate: false, repository: :in_memory, repository_url: 'http://localhost:8080/' } 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