Class: Sinclair::MethodDefinition::Stringifier Private

Inherits:
Caster show all
Defined in:
lib/sinclair/method_definition/stringifier.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.

Stringgify a value for StringDefinition

Author:

  • darthjee

Class Method Summary collapse

Methods inherited from Caster

cast, #cast, cast_with, caster_for, #initialize, master_caster!

Methods included from Caster::ClassMethods

#cast, #cast_with, #caster_for, #master_caster!

Constructor Details

This class inherits a constructor from Sinclair::Caster

Class Method Details

.value_string(value) ⇒ String

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.

Convert a value to a string format

The returned string can be evaluated as code, returning the original value

Parameters:

  • value (Object)

    object to be converted

Returns:

  • (String)


27
28
29
# File 'lib/sinclair/method_definition/stringifier.rb', line 27

def self.value_string(value)
  cast(value, value.class)
end