Class: BEL::Namespace::ResourceIndex
- Inherits:
-
Object
- Object
- BEL::Namespace::ResourceIndex
- Includes:
- Enumerable
- Defined in:
- lib/bel/namespace.rb
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #each ⇒ Object
- #each_annotation ⇒ Object
- #each_namespace ⇒ Object
-
#initialize(index, namespaces = [], annotations = []) ⇒ ResourceIndex
constructor
A new instance of ResourceIndex.
- #to_bel ⇒ Object
Constructor Details
#initialize(index, namespaces = [], annotations = []) ⇒ ResourceIndex
Returns a new instance of ResourceIndex.
173 174 175 176 177 178 |
# File 'lib/bel/namespace.rb', line 173 def initialize(index, namespaces = [], annotations = []) @index = index @namespaces = namespaces @annotations = annotations @loaded = false end |
Instance Attribute Details
#annotations ⇒ Object
185 186 187 188 |
# File 'lib/bel/namespace.rb', line 185 def annotations read_index if not @loaded @annotations end |
#namespaces ⇒ Object
180 181 182 183 |
# File 'lib/bel/namespace.rb', line 180 def namespaces read_index if not @loaded @namespaces end |
Class Method Details
.openbel_published_index(version) ⇒ Object
164 165 166 167 |
# File 'lib/bel/namespace.rb', line 164 def openbel_published_index(version) clean = version.to_s.strip ResourceIndex.new("http://resource.belframework.org/belframework/#{clean}/index.xml") end |
Instance Method Details
#each ⇒ Object
190 191 192 193 194 |
# File 'lib/bel/namespace.rb', line 190 def each read_index if not @loaded @namespaces.each { |x| yield x } @annotations.each { |x| yield x } end |
#each_annotation ⇒ Object
201 202 203 204 |
# File 'lib/bel/namespace.rb', line 201 def each_annotation read_index if not @loaded @annotations.each { |x| yield x } end |
#each_namespace ⇒ Object
196 197 198 199 |
# File 'lib/bel/namespace.rb', line 196 def each_namespace read_index if not @loaded @namespaces.each { |x| yield x } end |
#to_bel ⇒ Object
206 207 208 |
# File 'lib/bel/namespace.rb', line 206 def to_bel map { |x| x.to_bel } end |