Class: String

Inherits:
Object show all
Defined in:
lib/yake/support.rb

Instance Method Summary collapse

Instance Method Details

#/(path) ⇒ Object



120
# File 'lib/yake/support.rb', line 120

def /(path)             = File.join(self, path.to_s)

#camel_caseObject



121
# File 'lib/yake/support.rb', line 121

def camel_case          = split(/[_ ]/).map(&:capitalize).join

#decode64Object



122
# File 'lib/yake/support.rb', line 122

def decode64            = self.unpack1('m')

#encode64Object



123
# File 'lib/yake/support.rb', line 123

def encode64            = [self].pack('m')

#md5sumObject



124
# File 'lib/yake/support.rb', line 124

def md5sum              = Digest::MD5.hexdigest(self)

#sha1sumObject



125
# File 'lib/yake/support.rb', line 125

def sha1sum             = Digest::SHA1.hexdigest(self)

#snake_caseObject



126
# File 'lib/yake/support.rb', line 126

def snake_case          = gsub(/([a-z])([A-Z])/, '\1_\2').gsub(/ /, '_').downcase

#strict_decode64Object



127
# File 'lib/yake/support.rb', line 127

def strict_decode64     = self.unpack1('m0')

#strict_encode64Object



128
# File 'lib/yake/support.rb', line 128

def strict_encode64     = [self].pack('m0')

#to_dynamodbObject



129
# File 'lib/yake/support.rb', line 129

def to_dynamodb         = { S: self }

#to_h_from_formObject



131
# File 'lib/yake/support.rb', line 131

def to_h_from_form      = URI.decode_www_form(self).to_h

#to_h_from_jsonObject



130
# File 'lib/yake/support.rb', line 130

def to_h_from_json(...) = JSON.parse(self, ...)

#utcObject



132
# File 'lib/yake/support.rb', line 132

def utc                 = UTC.parse(self)