class String
Public Instance Methods
_hex_ord()
click to toggle source
# File lib/nydp/core_ext.rb, line 108 def _hex_ord ; ord.to_s(16).rjust(2, '0') ; end
_nydp_name_to_rb_name()
click to toggle source
_hex_ord
only works for characters whose ord is < 256, ie bytes returns a single-element array this should allow for two-way conversion of names containing the characters in the regexp even though we don’t use two-way conversion anywhere just yet
# File lib/nydp/core_ext.rb, line 105 def _nydp_name_to_rb_name ; self.gsub(/[\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]/) { |chr| "_#{chr._hex_ord}"}.to_sym ; end
as_method_name()
click to toggle source
# File lib/nydp/core_ext.rb, line 106 def as_method_name ; self.gsub(/-/, '_').to_sym ; end
nydp_type()
click to toggle source
# File lib/nydp/core_ext.rb, line 107 def nydp_type ; :string ; end