Sha256: f21653201d4f87ec6430c414fb67cd5d4b5a040e9f483082898e1c22843f3b12

Contents?: true

Size: 284 Bytes

Versions: 64

Compression:

Stored size: 284 Bytes

Contents

class Module #:nodoc:
  def dsl_accessor(*symbols)
    symbols.each do |sym|
      class_eval %{
        def #{sym}(*val)
          if val.empty?
            @#{sym}
          else
            @#{sym} = val.size == 1 ? val[0] : val
          end
        end
      }
    end
  end
end

Version data entries

64 entries across 64 versions & 12 rubygems

Version Path
auser-sprinkle-0.1.6 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.1.6 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.1.7 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.1.8 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.1.9 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.2.0 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.2.1 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.2.2 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.2.3 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.2.4 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.2.5 lib/sprinkle/extensions/dsl_accessor.rb
crafterm-sprinkle-0.2.6 lib/sprinkle/extensions/dsl_accessor.rb
jsierles-sprinkle-0.1.9 lib/sprinkle/extensions/dsl_accessor.rb
justsee-sprinkle-0.2.4 lib/sprinkle/extensions/dsl_accessor.rb
lachlan-sprinkle-0.0.1 lib/sprinkle/extensions/dsl_accessor.rb
lachlan-sprinkle-0.0.10 lib/sprinkle/extensions/dsl_accessor.rb
lachlan-sprinkle-0.0.11 lib/sprinkle/extensions/dsl_accessor.rb
lachlan-sprinkle-0.0.13 lib/sprinkle/extensions/dsl_accessor.rb
lachlan-sprinkle-0.0.14 lib/sprinkle/extensions/dsl_accessor.rb
lachlan-sprinkle-0.0.15 lib/sprinkle/extensions/dsl_accessor.rb