Module: Vizier::Support::ClassMethods

Defined in:
lib/support/vizier.rb

Instance Method Summary collapse

Instance Method Details

#finder(name) ⇒ Object


66
67
68
69
70
71
72
# File 'lib/support/vizier.rb', line 66

def finder( name )
  class_eval do
    define_method name do
      instance_variable_get( "@#{name}" ).extend( Finder )
    end
  end
end

#sanitize(str) ⇒ Object


62
63
64
# File 'lib/support/vizier.rb', line 62

def sanitize( str )
  str.to_s.gsub(/[^#{LEGAL_CHARS}]/,'_').gsub(/__+/,'_')
end