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.
170 171 172 173 174 175 |
# File 'lib/bel/namespace.rb', line 170 def initialize(index, namespaces = [], annotations = []) @index = index @namespaces = namespaces @annotations = annotations @loaded = false end |
Instance Attribute Details
#annotations ⇒ Object
182 183 184 185 |
# File 'lib/bel/namespace.rb', line 182 def annotations read_index if not @loaded @annotations end |
#namespaces ⇒ Object
177 178 179 180 |
# File 'lib/bel/namespace.rb', line 177 def namespaces read_index if not @loaded @namespaces end |
Class Method Details
.openbel_published_index(version) ⇒ Object
161 162 163 164 |
# File 'lib/bel/namespace.rb', line 161 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
187 188 189 190 191 |
# File 'lib/bel/namespace.rb', line 187 def each read_index if not @loaded @namespaces.each { |x| yield x } @annotations.each { |x| yield x } end |
#each_annotation ⇒ Object
198 199 200 201 |
# File 'lib/bel/namespace.rb', line 198 def each_annotation read_index if not @loaded @annotations.each { |x| yield x } end |
#each_namespace ⇒ Object
193 194 195 196 |
# File 'lib/bel/namespace.rb', line 193 def each_namespace read_index if not @loaded @namespaces.each { |x| yield x } end |
#to_bel ⇒ Object
203 204 205 |
# File 'lib/bel/namespace.rb', line 203 def to_bel map { |x| x.to_bel } end |