Class: ResponseMatcher::ParseSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/response_matcher/parse_schema.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema_path, objects) ⇒ ParseSchema

Returns a new instance of ParseSchema.



12
13
14
15
16
17
18
# File 'lib/response_matcher/parse_schema.rb', line 12

def initialize(schema_path, objects)
  @schema_path = schema_path
  @objects = objects

  initialize_objects
  render_schema
end

Instance Attribute Details

#objectsObject (readonly)

Returns the value of attribute objects.



10
11
12
# File 'lib/response_matcher/parse_schema.rb', line 10

def objects
  @objects
end

#responseObject (readonly)

Returns the value of attribute response.



10
11
12
# File 'lib/response_matcher/parse_schema.rb', line 10

def response
  @response
end

#schema_pathObject (readonly)

Returns the value of attribute schema_path.



10
11
12
# File 'lib/response_matcher/parse_schema.rb', line 10

def schema_path
  @schema_path
end

Class Method Details

.new(schema_path, objects = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/response_matcher/parse_schema.rb', line 3

def self.new(schema_path, objects = {})
  Settings.config.helpers.each { |helper| include helper }
  attr_accessor(*objects.keys)

  super(schema_path, objects)
end

Instance Method Details

#call(schema_path, objects = {}) ⇒ Object



20
21
22
# File 'lib/response_matcher/parse_schema.rb', line 20

def call(schema_path, objects = {})
  self.class.new(schema_path, objects).response
end