Class: Sinclair::MethodDefinition::Stringifier Private
- 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
Class Method Summary collapse
-
.value_string(value) ⇒ String
private
Convert a value to a string format.
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
20 21 22 23 24 25 26 27 |
# File 'lib/sinclair/method_definition/stringifier.rb', line 20 def self.value_string(value) return 'nil' if value.nil? return ":#{value}" if value.is_a?(Symbol) return value.to_s if value.is_any?(Class, Hash, Array) value.to_json end |