class Helper::SchemaListHelper

Public Class Methods

new( schema_name, schema_path = "api/schemas/data/orchestrate.json" ) click to toggle source
# File lib/helper/schema_list_helper.rb, line 9
def initialize(
  schema_name,
  schema_path = "api/schemas/data/orchestrate.json"
)
  @schema_name = schema_name.to_sym
  @schema_path = schema_path

  data = File.read File.join Dir.pwd, @schema_path
  schema_variations = JSON.parse(data).deep_transform_keys(&:to_sym)

  @schema_active = schema_variations[@schema_name]
end

Public Instance Methods

schema_exists?() click to toggle source
# File lib/helper/schema_list_helper.rb, line 22
def schema_exists?
  @schema_active != nil
end
schema_path() click to toggle source
# File lib/helper/schema_list_helper.rb, line 26
def schema_path
  @schema_active[:schema_path]
end