Class: NamedReturn::DefaultConfig
- Inherits:
-
Struct
- Object
- Struct
- NamedReturn::DefaultConfig
- Defined in:
- lib/named_return.rb
Instance Method Summary collapse
-
#auto_wrap?(name, singleton) ⇒ Boolean
Should a method be wrapped by named_return?.
-
#initialize ⇒ DefaultConfig
constructor
Sets defaults.
Constructor Details
#initialize ⇒ DefaultConfig
Sets defaults.
11 12 13 14 15 |
# File 'lib/named_return.rb', line 11 def initialize self.return = false self.only = [] self.class_only = [] end |
Instance Method Details
#auto_wrap?(name, singleton) ⇒ Boolean
Should a method be wrapped by named_return?
18 19 20 21 22 23 24 25 |
# File 'lib/named_return.rb', line 18 def auto_wrap?(name, singleton) if singleton class_only.include?(name) || (class_except && !class_except.include?(name)) else only.include?(name) || (except && !except.include?(name)) end end |