Class: String
Instance Method Summary collapse
- #/(path) ⇒ Object
- #camel_case ⇒ Object
- #decode64 ⇒ Object
- #encode64 ⇒ Object
- #md5sum ⇒ Object
- #sha1sum ⇒ Object
- #snake_case ⇒ Object
- #strict_decode64 ⇒ Object
- #strict_encode64 ⇒ Object
- #to_dynamodb ⇒ Object
- #to_h_from_form ⇒ Object
- #to_h_from_json ⇒ Object
- #utc ⇒ Object
Instance Method Details
#/(path) ⇒ Object
120 |
# File 'lib/yake/support.rb', line 120 def /(path) = File.join(self, path.to_s) |
#camel_case ⇒ Object
121 |
# File 'lib/yake/support.rb', line 121 def camel_case = split(/[_ ]/).map(&:capitalize).join |
#decode64 ⇒ Object
122 |
# File 'lib/yake/support.rb', line 122 def decode64 = self.unpack1('m') |
#encode64 ⇒ Object
123 |
# File 'lib/yake/support.rb', line 123 def encode64 = [self].pack('m') |
#md5sum ⇒ Object
124 |
# File 'lib/yake/support.rb', line 124 def md5sum = Digest::MD5.hexdigest(self) |
#sha1sum ⇒ Object
125 |
# File 'lib/yake/support.rb', line 125 def sha1sum = Digest::SHA1.hexdigest(self) |
#snake_case ⇒ Object
126 |
# File 'lib/yake/support.rb', line 126 def snake_case = gsub(/([a-z])([A-Z])/, '\1_\2').gsub(/ /, '_').downcase |
#strict_decode64 ⇒ Object
127 |
# File 'lib/yake/support.rb', line 127 def strict_decode64 = self.unpack1('m0') |
#strict_encode64 ⇒ Object
128 |
# File 'lib/yake/support.rb', line 128 def strict_encode64 = [self].pack('m0') |
#to_dynamodb ⇒ Object
129 |
# File 'lib/yake/support.rb', line 129 def to_dynamodb = { S: self } |
#to_h_from_form ⇒ Object
131 |
# File 'lib/yake/support.rb', line 131 def to_h_from_form = URI.decode_www_form(self).to_h |
#to_h_from_json ⇒ Object
130 |
# File 'lib/yake/support.rb', line 130 def to_h_from_json(...) = JSON.parse(self, ...) |