Sha256: 30a894130ee3e48b15f7220ba8c388b393486f1d6a4f8b6c2c907151109a2ed5

Contents?: true

Size: 1012 Bytes

Versions: 4

Compression:

Stored size: 1012 Bytes

Contents

require 'rdf'
require 'active_triples/version'
require 'active_support'

module ActiveTriples
  extend ActiveSupport::Autoload
  eager_autoload do
    autoload :Resource
    autoload :List
    autoload :Term
    autoload :Indexing
    autoload :Configurable
    autoload :Properties
    autoload :PropertyBuilder
    autoload :Reflection
    autoload :Repositories
    autoload :NodeConfig
    autoload :NestedAttributes
    autoload :Identifiable
  end

  def self.class_from_string(class_name, container_class=Kernel)
    container_class = container_class.name if container_class.is_a? Module
    container_parts = container_class.split('::')
    (container_parts + class_name.split('::')).flatten.inject(Kernel) do |mod, class_name|
      if mod == Kernel
        Object.const_get(class_name)
      elsif mod.const_defined? class_name.to_sym
        mod.const_get(class_name)
      else
        container_parts.pop
        class_from_string(class_name, container_parts.join('::'))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active-triples-0.4.1 lib/active_triples.rb
active-triples-0.5.0 lib/active_triples.rb
active-triples-0.4.0 lib/active_triples.rb
active-triples-0.3.1 lib/active_triples.rb