0.0
No release in over 3 years
Low commit activity in last 3 years
Generates class level configure methods
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Configure

Examples

Activation

Default

require 'configure'; Configure.activate

Specifying a default factory method

The configure library will use .build as the factory method by default. To override, supply factory_method to Configure.activate:

require 'configure'; Configure.activate factory_method: :create

Usage

Defining a configure method

class SomeClass
  configure :some_attr_name
end

Configuring a receiver

receiver = OpenStruct.new

SomeClass.configure receiver

# Returns instance of SomeClass
receiver.some_attr_name

Specifying the attribute name on the receiver

receiver = OpenStruct.new

SomeClass.configure receiver, attr_name: :other_attr_name

# Returns instance of SomeClass
receiver.other_attr_name