Module: BELParser::Language::Specification

Included in:
BaseSpecification
Defined in:
lib/bel_parser/language/specification.rb

Overview

Specification defines the common behavior of any language specification. It includes the syntactic and semantic rules of the language.

Constant Summary collapse

EMPTY_ARRAY =
[].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#causal_relationshipsObject (readonly)

Returns the value of attribute causal_relationships.



52
53
54
# File 'lib/bel_parser/language/specification.rb', line 52

def causal_relationships
  @causal_relationships
end

#correlative_relationshipsObject (readonly)

Returns the value of attribute correlative_relationships.



53
54
55
# File 'lib/bel_parser/language/specification.rb', line 53

def correlative_relationships
  @correlative_relationships
end

#decreasing_relationshipsObject (readonly)

Returns the value of attribute decreasing_relationships.



54
55
56
# File 'lib/bel_parser/language/specification.rb', line 54

def decreasing_relationships
  @decreasing_relationships
end

#deprecated_relationshipsObject (readonly)

Returns the value of attribute deprecated_relationships.



55
56
57
# File 'lib/bel_parser/language/specification.rb', line 55

def deprecated_relationships
  @deprecated_relationships
end

#direct_relationshipsObject (readonly)

Returns the value of attribute direct_relationships.



56
57
58
# File 'lib/bel_parser/language/specification.rb', line 56

def direct_relationships
  @direct_relationships
end

#directed_relationshipsObject (readonly)

Returns the value of attribute directed_relationships.



57
58
59
# File 'lib/bel_parser/language/specification.rb', line 57

def directed_relationships
  @directed_relationships
end

#genomic_relationshipsObject (readonly)

Returns the value of attribute genomic_relationships.



58
59
60
# File 'lib/bel_parser/language/specification.rb', line 58

def genomic_relationships
  @genomic_relationships
end

#increasing_relationshipsObject (readonly)

Returns the value of attribute increasing_relationships.



59
60
61
# File 'lib/bel_parser/language/specification.rb', line 59

def increasing_relationships
  @increasing_relationships
end

#indirect_relationshipsObject (readonly)

Returns the value of attribute indirect_relationships.



60
61
62
# File 'lib/bel_parser/language/specification.rb', line 60

def indirect_relationships
  @indirect_relationships
end

#listable_relationshipsObject (readonly)

Returns the value of attribute listable_relationships.



61
62
63
# File 'lib/bel_parser/language/specification.rb', line 61

def listable_relationships
  @listable_relationships
end

#self_relationshipsObject (readonly)

Returns the value of attribute self_relationships.



62
63
64
# File 'lib/bel_parser/language/specification.rb', line 62

def self_relationships
  @self_relationships
end

Instance Method Details

#freeze_categoriesObject



122
123
124
125
126
127
# File 'lib/bel_parser/language/specification.rb', line 122

def freeze_categories
  instance_variables.each do |ivar|
    next unless ivar.to_s =~ /@[a-zA-Z0-9]+_relationships/
    instance_variable_set(ivar, instance_variable_get(ivar).freeze)
  end
end

#function(short_or_long_form) ⇒ Object



16
17
18
# File 'lib/bel_parser/language/specification.rb', line 16

def function(short_or_long_form)
  @indexed_functions[short_or_long_form]
end

#functions(*short_or_long_form) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/bel_parser/language/specification.rb', line 32

def functions(*short_or_long_form)
  if short_or_long_form.empty?
    @functions.freeze
  else
    @indexed_functions.values_at(*short_or_long_form)
  end
end

#inspectObject



72
73
74
# File 'lib/bel_parser/language/specification.rb', line 72

def inspect
  "BEL specification, version #@version"
end

#relationship(short_or_long_form) ⇒ Object



20
21
22
# File 'lib/bel_parser/language/specification.rb', line 20

def relationship(short_or_long_form)
  @indexed_relationships[short_or_long_form]
end

#relationships(*short_or_long_form) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/bel_parser/language/specification.rb', line 40

def relationships(*short_or_long_form)
  if short_or_long_form.empty?
    @relationships.freeze
  else
    @indexed_relationships.values_at(*short_or_long_form)
  end
end

#return_type(return_type) ⇒ Object



24
25
26
# File 'lib/bel_parser/language/specification.rb', line 24

def return_type(return_type)
  @indexed_return_types[return_type]
end

#return_types(*return_types) ⇒ Object



64
65
66
67
68
69
70
# File 'lib/bel_parser/language/specification.rb', line 64

def return_types(*return_types)
  if return_types.empty?
    @return_types.freeze
  else
    @indexed_return_types.values_at(*return_types)
  end
end

#upgradesObject



48
49
50
# File 'lib/bel_parser/language/specification.rb', line 48

def upgrades
  @upgrades.freeze
end

#uriObject



8
9
10
# File 'lib/bel_parser/language/specification.rb', line 8

def uri
  @uri
end

#value_encoding(value_encoding) ⇒ Object



28
29
30
# File 'lib/bel_parser/language/specification.rb', line 28

def value_encoding(value_encoding)
  @indexed_value_encodings[value_encoding]
end

#versionObject



12
13
14
# File 'lib/bel_parser/language/specification.rb', line 12

def version
  @version
end