Class: R2OAS::Schema::Editor

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/r2-oas/schema/editor.rb

Constant Summary collapse

TMP_FILE_NAME =
'edited_schema'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(before_schema_data, options) ⇒ Editor

Returns a new instance of Editor.



26
27
28
29
30
# File 'lib/r2-oas/schema/editor.rb', line 26

def initialize(before_schema_data, options)
  super(options)
  @editor = swagger.editor
  @before_schema_data = before_schema_data
end

Instance Attribute Details

#edited_schemaObject

Returns the value of attribute edited_schema.



24
25
26
# File 'lib/r2-oas/schema/editor.rb', line 24

def edited_schema
  @edited_schema
end

Instance Method Details

#startObject



32
33
34
35
36
37
38
39
40
# File 'lib/r2-oas/schema/editor.rb', line 32

def start
  EM.run do
    container.start
    open_browser_and_set_schema
    ensure_save_tmp_schema_file
    signal_trap('INT')
    signal_trap('TERM')
  end
end