module KeyPath::StringExtensions
Extensions to `String`.
Public Instance Methods
is_number?()
click to toggle source
# File lib/key_path/string/extensions.rb, line 18 def is_number? true if Float(self) rescue false end
is_plural?()
click to toggle source
# File lib/key_path/string/extensions.rb, line 14 def is_plural? singularize != self && pluralize == self end
is_singular?()
click to toggle source
# File lib/key_path/string/extensions.rb, line 10 def is_singular? pluralize != self && singularize == self end
to_keypath()
click to toggle source
# File lib/key_path/string/extensions.rb, line 6 def to_keypath KeyPath::Path.new self end