Module: SubstAttr::Substitute::NullObject
- Extended by:
- NullObject
- Included in:
- NullObject
- Defined in:
- lib/subst_attr/substitute/null_object.rb
Constant Summary collapse
- Weak =
Mimic::Build.(Object, record: false) do def method_missing(*) end end
Instance Method Summary collapse
Instance Method Details
#build(interface = nil) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/subst_attr/substitute/null_object.rb', line 6 def build(interface=nil) if interface return strict(interface) end weak end |
#strict(interface) ⇒ Object
14 15 16 |
# File 'lib/subst_attr/substitute/null_object.rb', line 14 def strict(interface) Mimic.(interface, record: false) end |
#weak ⇒ Object
18 19 20 |
# File 'lib/subst_attr/substitute/null_object.rb', line 18 def weak Weak.new end |