Skip to content

eventide-project/configure

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •