Class: MdSplitter::ElfManifestBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/md_splitter/elf_manifest_builder.rb

Instance Method Summary collapse

Constructor Details

#initializeElfManifestBuilder

  • Args :

    • ++ ->

  • Returns : -

  • Raises :

    • ++ ->



18
19
20
21
# File 'lib/md_splitter/elf_manifest_builder.rb', line 18

def initialize
  @raw_object = {}  
  @logger = Logger.new(STDOUT)  
end

Instance Method Details

#build(raw_obj, requested_id) ⇒ Object

  • Args :

    • ++ ->

  • Returns : -

  • Raises :

    • ++ ->



32
33
34
# File 'lib/md_splitter/elf_manifest_builder.rb', line 32

def build raw_obj, requested_id
  @raw_object = build_manifest_object raw_obj, requested_id
end

#jsonObject



49
50
51
52
# File 'lib/md_splitter/elf_manifest_builder.rb', line 49

def json 
  puts "Generating json string from #{@raw_object}"
  JSON.pretty_generate @raw_object
end

#rawObject

Accepts an ennumerable object and returns a json manifest

  • Args :

    • items -> OBJECT from which to build the manifest

  • Returns :

    • JSON manifest

  • Raises :

    • ++ ->



45
46
47
# File 'lib/md_splitter/elf_manifest_builder.rb', line 45

def raw 
  @raw_object
end