Module: KeyPath::StringExtensions

Included in:
String
Defined in:
lib/key_path/string/extensions.rb

Instance Method Summary collapse

Instance Method Details

#is_number?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/key_path/string/extensions.rb', line 17

def is_number?
  true if Float(self) rescue false
end

#is_plural?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/key_path/string/extensions.rb', line 13

def is_plural?
  self.singularize != self and self.pluralize == self
end

#is_singular?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/key_path/string/extensions.rb', line 9

def is_singular?
  self.pluralize != self and self.singularize == self
end

#to_keypathObject



5
6
7
# File 'lib/key_path/string/extensions.rb', line 5

def to_keypath
  KeyPath::Path.new self
end