Module: Loba::Internal Private
- Defined in:
- lib/loba/internal.rb,
lib/loba/internal/value.rb,
lib/loba/internal/platform.rb,
lib/loba/internal/settings.rb,
lib/loba/internal/time_keeper.rb,
lib/loba/internal/platform/formatter.rb,
lib/loba/internal/value/value_helper.rb,
lib/loba/internal/platform/within_rails.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Internal functionality support
Defined Under Namespace
Modules: Platform, Value Classes: Settings, TimeKeeper
Class Method Summary collapse
-
.boolean_cast(value) ⇒ true, false
private
Casts any value to true or false (boolean).
-
.unquote(content) ⇒ String, Object
private
Remove wrapping quotes on a string (produced by .inspect).
Class Method Details
.boolean_cast(value) ⇒ true, false
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.
Casts any value to true or false (boolean)
48 49 50 51 52 |
# File 'lib/loba/internal.rb', line 48 def boolean_cast(value) return false if value.respond_to?(:empty) && value.empty? !FALSE_VALUES.include?(value) end |
.unquote(content) ⇒ String, Object
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.
Remove wrapping quotes on a string (produced by .inspect)
21 22 23 24 25 26 |
# File 'lib/loba/internal.rb', line 21 def unquote(content) return content unless content.is_a?(String) return content unless content[0] == '"' && content[-1] == '"' content[1...-1] end |