Class: BELParser::Language::BaseSpecification

Inherits:
Object
  • Object
show all
Includes:
Specification
Defined in:
lib/bel_parser/language/base_specification.rb

Overview

BaseSpecification defines behaviour for loading BEL version files.

Constant Summary

Constants included from Specification

Specification::EMPTY_ARRAY

Instance Attribute Summary

Attributes included from Specification

#causal_relationships, #correlative_relationships, #decreasing_relationships, #deprecated_relationships, #direct_relationships, #directed_relationships, #genomic_relationships, #increasing_relationships, #indirect_relationships, #listable_relationships, #self_relationships

Class Method Summary collapse

Methods included from Specification

#freeze_categories, #function, #functions, #inspect, #relationship, #relationships, #return_type, #return_types, #upgrades, #uri, #value_encoding, #version

Class Method Details

.load_version_path(version_path) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/bel_parser/language/base_specification.rb', line 9

def self.load_version_path(version_path)
  base_path = File.expand_path(File.dirname(__FILE__)) + File::SEPARATOR
  ['return_types', 'value_encodings', 'functions', 'relationships', 'upgrades']
    .each do |set|
      Dir[File.join(base_path, version_path, set, '*.rb')]
        .each do |ruby_file|
          ruby_file.sub!(/^#{Regexp.escape(base_path)}/, '')
          require_relative ruby_file
        end
    end
end