module Mingle::StringParser

Including classes must define impl_parse() as a class method; this module will add class methods parse()/get() which can take any of PARSED_TYPES and return an instance according to impl_parse. Also installs BitGirderClass instance handlers for PARSED_TYPES

Public Class Methods

get( val ) click to toggle source
# File lib/mingle.rb, line 1692
def self.get( val )
    self.as_instance( val )
end
included( cls ) click to toggle source
# File lib/mingle.rb, line 1686
def self.included( cls )

    cls.class_eval do

        map_instance_of( *PARSED_TYPES ) { |s| self.impl_parse( s.to_s ) }

        def self.get( val )
            self.as_instance( val )
        end

        def self.parse( val )
            self.as_instance( val )
        end
    end
end
parse( val ) click to toggle source
# File lib/mingle.rb, line 1696
def self.parse( val )
    self.as_instance( val )
end