Helpers for creating internal DSLs
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
README.rdoc
Rakefile
VERSION

README.rdoc

Dsl Helper

Usage

require 'dsl_helper'

class MyDSLConfig

  include DslHelper

  dsl_attr :host, :port, :name
end

config = MyDSLConfig.new.instance_eval do
  host 'localhost'
  port 11345
  name 'my_network_thingy'
end

Then calls to the underscore versions of the attribute accessors work normally

config._host

Returns

>> 'localhost'