Class: Medschool::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/medschool/example.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, example_name) ⇒ Example

Returns a new instance of Example.



3
4
5
6
7
# File 'lib/medschool/example.rb', line 3

def initialize(path, example_name)
  self.path = File.join(Medschool.root, "#{path}.md.med")
  self.example_name = example_name
  load_examples
end

Instance Method Details

#request_hashObject



9
10
11
# File 'lib/medschool/example.rb', line 9

def request_hash
  Medschool::HashGenerator.new(raw_request[:data]).process
end

#validate_response(response) ⇒ Object



13
14
15
# File 'lib/medschool/example.rb', line 13

def validate_response(response)
  Medschool::Validator.new(raw_response, response).validate!
end