Class: Uber::InheritableAttr::Clone
- Inherits:
-
Object
- Object
- Uber::InheritableAttr::Clone
- Defined in:
- lib/uber/inheritable_attr.rb
Class Method Summary collapse
-
.call(value, uncloneable = uncloneable()) ⇒ Object
The second argument allows injecting more types.
- .uncloneable ⇒ Object
Class Method Details
.call(value, uncloneable = uncloneable()) ⇒ Object
The second argument allows injecting more types.
25 26 27 28 |
# File 'lib/uber/inheritable_attr.rb', line 25 def self.call(value, uncloneable=uncloneable()) uncloneable.each { |klass| return value if value.kind_of?(klass) } value.clone end |
.uncloneable ⇒ Object
30 31 32 |
# File 'lib/uber/inheritable_attr.rb', line 30 def self.uncloneable [Symbol, TrueClass, FalseClass, NilClass] end |