Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/string.rb
Instance Method Summary collapse
Instance Method Details
#join_path(*paths) ⇒ Object
21 22 23 |
# File 'lib/string.rb', line 21 def join_path(*paths) paths.prepend(self).compact.reject(&:empty?).join("/") end |
#to_graph_attribute ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/string.rb', line 9 def to_graph_attribute if OAuth2::Version.major > 1 # OAuth2 uses SnakyHash in parsed response from version 2 on. This # already takes care of "rails-like" attribute name conversions. self else # OAuth2 instead uses a regular hash, so we need to convert attribute # names ourselves. self.camelize(:lower) end end |
#to_graph_resource ⇒ Object
5 6 7 |
# File 'lib/string.rb', line 5 def to_graph_resource self.camelize(:lower).pluralize end |