# module OpEsc

# OpEsc¶ ↑

NOTE: As of v3.0 of Facets these have been renamed:

    op_plus_self   -> op_plus
    op_minus_self  -> op_minus
    op_plus        -> op_add
    op_minus       -> op_sub
    op_case_eq     -> op_case

TODO: In the future we might also rename:

    op_lshift      -> op_push
    op_rshift      -> op_pull
    op_store       -> op_index
    op_fetch       -> op_index  (b/c [] and []= in same file)

### Constants

OPERATORS
OPERATORS_ESC_TABLE
OPERATORS_REGEXP

### Public Class Methods

escape(str) click to toggle source

Applies operator escape's according to OPERATORS_ESCAPE_TABLE.

    OpEsc.escape('-') #=> "op_sub"

CREDIT: Trans

    # File lib/facets/opesc.rb, line 55
    def self.escape(str)
      str.to_s.gsub(OPERATORS_REGEXP){ OPERATORS_ESC_TABLE[$1] }
    end

method_to_filename(name) click to toggle source

    # File lib/facets/opesc.rb, line 60
    def self.method_to_filename(name)
      fname = escape(name)
      fname = fname[0...-1] if fname =~ /[\!\=\?]$/
      fname
    end