Class: Lurker::Json::Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/lurker/json/writer.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Writer

Returns a new instance of Writer.



10
11
12
13
# File 'lib/lurker/json/writer.rb', line 10

def initialize(path)
  @path = path
  @dirname = File.dirname(path)
end

Class Method Details

.write(schema, path) ⇒ Object



5
6
7
# File 'lib/lurker/json/writer.rb', line 5

def write(schema, path)
  new(path).write(schema)
end

Instance Method Details

#write(schema) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/lurker/json/writer.rb', line 15

def write(schema)
  write_to_file(schema)

  extract_references(schema).each do |reference|
    Lurker::Json::Writer.write(reference, reference.original_uri.path)
  end
end