Class: Pubid::Ogc::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/pubid/ogc/builder.rb

Overview

Turns the parse tree into an Ogc::Identifiers::Document. OGC has a single document type, so there is no type dispatch.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(parsed_data) ⇒ Object



8
9
10
# File 'lib/pubid/ogc/builder.rb', line 8

def self.build(parsed_data)
  new.build(parsed_data)
end

Instance Method Details

#build(data) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/pubid/ogc/builder.rb', line 12

def build(data)
  Identifiers::Document.new(
    year: data[:year].to_s,
    number: data[:number].to_s,
    revision: normalize_revision(data[:revision]),
  )
end