Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/yake/support.rb
Instance Method Summary collapse
- #/(path) ⇒ Object
- #camel_case ⇒ Object
- #decode64 ⇒ Object
- #encode64 ⇒ Object
- #snake_case ⇒ Object
- #strict_decode64 ⇒ Object
- #strict_encode64 ⇒ Object
- #to_h_from_form ⇒ Object
- #to_h_from_json(**params) ⇒ Object
Instance Method Details
#/(path) ⇒ Object
29 |
# File 'lib/yake/support.rb', line 29 def /(path) File.join(self, path.to_s) end |
#camel_case ⇒ Object
30 |
# File 'lib/yake/support.rb', line 30 def camel_case() split(/_/).map(&:capitalize).join end |
#decode64 ⇒ Object
31 |
# File 'lib/yake/support.rb', line 31 def decode64() Base64.decode64(self) end |
#encode64 ⇒ Object
32 |
# File 'lib/yake/support.rb', line 32 def encode64() Base64.encode64(self) end |
#snake_case ⇒ Object
33 |
# File 'lib/yake/support.rb', line 33 def snake_case() gsub(/([a-z])([A-Z])/, '\1_\2').downcase end |
#strict_decode64 ⇒ Object
34 |
# File 'lib/yake/support.rb', line 34 def strict_decode64() Base64.strict_decode64(self) end |
#strict_encode64 ⇒ Object
35 |
# File 'lib/yake/support.rb', line 35 def strict_encode64() Base64.strict_encode64(self) end |
#to_h_from_form ⇒ Object
37 |
# File 'lib/yake/support.rb', line 37 def to_h_from_form() URI.decode_www_form(self).to_h end |
#to_h_from_json(**params) ⇒ Object
36 |
# File 'lib/yake/support.rb', line 36 def to_h_from_json(**params) JSON.parse(self, **params) end |