File: const_missing_extensions.rb

package info (click to toggle)
ruby-virtus 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 660 kB
  • sloc: ruby: 4,378; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Virtus
  module ConstMissingExtensions

    # Hooks into const missing process to determine types of attributes
    #
    # @param [String] name
    #
    # @return [Class]
    #
    # @api private
    def const_missing(name)
      Attribute::Builder.determine_type(name) or
        Axiom::Types.const_defined?(name) && Axiom::Types.const_get(name) or
        super
    end

  end
end