lib/tomograph/tomogram.rb in tomograph-3.0.0 vs lib/tomograph/tomogram.rb in tomograph-3.0.1
- old
+ new
@@ -1,22 +1,22 @@
-require 'multi_json'
+require 'json'
require 'tomograph/path'
require 'tomograph/api_blueprint/json_schema'
require 'tomograph/api_blueprint/drafter_4/yaml'
require 'tomograph/api_blueprint/crafter/yaml'
module Tomograph
class Tomogram
extend Gem::Deprecate
- def initialize(prefix: '', apib_path: nil, drafter_yaml_path: nil, tomogram_json_path: nil, drafter_4_apib_path: nil, drafter_4_yaml_path: nil, crafter_apib_path: nil, crafter_yaml_path: nil)
+ def initialize(prefix: '', drafter_yaml_path: nil, tomogram_json_path: nil, crafter_yaml_path: nil)
@documentation = if tomogram_json_path
Tomograph::ApiBlueprint::JsonSchema.new(prefix, tomogram_json_path)
- elsif crafter_yaml_path || crafter_apib_path
- Tomograph::ApiBlueprint::Crafter::Yaml.new(prefix, crafter_apib_path, crafter_yaml_path)
+ elsif crafter_yaml_path
+ Tomograph::ApiBlueprint::Crafter::Yaml.new(prefix, crafter_yaml_path)
else
- Tomograph::ApiBlueprint::Drafter4::Yaml.new(prefix, drafter_4_apib_path, drafter_4_yaml_path)
+ Tomograph::ApiBlueprint::Drafter4::Yaml.new(prefix, drafter_yaml_path)
end
@prefix = prefix
end
def to_a
@@ -27,10 +27,10 @@
to_a.map(&:to_hash)
end
deprecate :to_hash, 'to_a with method access', 2018, 8
def to_json
- MultiJson.dump(to_a.map(&:to_hash), pretty: true)
+ JSON.pretty_generate(to_a.map(&:to_hash))
end
def find_request(method:, path:)
path = Tomograph::Path.new(path).to_s