Class: Naught::NullClassBuilder::Commands::PredicatesReturn Private

Inherits:
Naught::NullClassBuilder::Command show all
Defined in:
lib/naught/null_class_builder/commands/predicates_return.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Overrides predicate methods to return a fixed value

Instance Attribute Summary

Attributes inherited from Naught::NullClassBuilder::Command

#builder

Instance Method Summary collapse

Constructor Details

#initialize(builder, return_value) ⇒ PredicatesReturn

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a predicates_return command with the given value

Parameters:

  • builder (NullClassBuilder)
  • return_value (Object)

    value to return for predicate methods



15
16
17
18
# File 'lib/naught/null_class_builder/commands/predicates_return.rb', line 15

def initialize(builder, return_value)
  super(builder)
  @return_value = return_value
end

Instance Method Details

#callvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Apply predicate overrides



23
24
25
26
# File 'lib/naught/null_class_builder/commands/predicates_return.rb', line 23

def call
  install_method_missing_override
  install_predicate_method_overrides
end