Module: NamedReturn::Core
- Defined in:
- lib/named_return/core.rb
Overview
Mix in to your class to make the magic happen.
Defined Under Namespace
Modules: ClassMethods
Class Attribute Summary collapse
-
.options ⇒ Object
raw options that later get set on config.
Class Method Summary collapse
-
.[](**options) ⇒ Object
Set config options local to your class.
- .included(obj) ⇒ Object
Class Attribute Details
.options ⇒ Object
raw options that later get set on config
29 30 31 |
# File 'lib/named_return/core.rb', line 29 def end |
Class Method Details
.[](**options) ⇒ Object
Set config options local to your class.
33 34 35 |
# File 'lib/named_return/core.rb', line 33 def self.[](**) clone.tap { |cls| cls. = } end |
.included(obj) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/named_return/core.rb', line 37 def self.included(obj) proxy = Proxy.new( || {}) # creating a closure obj.send(:define_singleton_method, :_named_return_proxy) { proxy } # obj.send(:private, :_named_return_proxy) obj.extend clone.const_get(:ClassMethods) end |