Class: BEL::Extension::Format::FormatBEL
- Inherits:
-
Object
- Object
- BEL::Extension::Format::FormatBEL
- Includes:
- Formatter
- Defined in:
- lib/bel/extensions/bel.rb
Constant Summary collapse
- ID =
:bel
- MEDIA_TYPES =
%i(application/bel)
- EXTENSIONS =
%i(bel)
Instance Method Summary collapse
- #deserialize(data, &block) ⇒ Object
- #file_extensions ⇒ Object
- #id ⇒ Object
- #media_types ⇒ Object
- #serialize(objects, writer = StringIO.new, options = {}) ⇒ Object
Methods included from Formatter
Instance Method Details
#deserialize(data, &block) ⇒ Object
25 26 27 |
# File 'lib/bel/extensions/bel.rb', line 25 def deserialize(data, &block) EvidenceYielder.new(data) end |
#file_extensions ⇒ Object
21 22 23 |
# File 'lib/bel/extensions/bel.rb', line 21 def file_extensions EXTENSIONS end |
#id ⇒ Object
13 14 15 |
# File 'lib/bel/extensions/bel.rb', line 13 def id ID end |
#media_types ⇒ Object
17 18 19 |
# File 'lib/bel/extensions/bel.rb', line 17 def media_types MEDIA_TYPES end |
#serialize(objects, writer = StringIO.new, options = {}) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/bel/extensions/bel.rb', line 29 def serialize(objects, writer = StringIO.new, = {}) BELYielder.new(objects).each { |bel_part| writer << "#{bel_part}" writer.flush } end |