Class: Netologiest::Course

Inherits:
Resource show all
Defined in:
lib/netologiest/resources/course.rb

Overview

Child class for Resource describe rules for parsing Netology response

Instance Attribute Summary

Attributes inherited from Resource

#token, #token_expire

Instance Method Summary collapse

Methods inherited from Resource

#authorize!, detail, #detail, #get, #initialize, #list, list, #token_expired?

Constructor Details

This class inherits a constructor from Netologiest::Resource

Instance Method Details

#handle_detail(response) ⇒ Object

it returns a Hash instance it contains deep elements:

> blocks: [[{questions: []]]



16
17
18
# File 'lib/netologiest/resources/course.rb', line 16

def handle_detail(response)
  parse_json(response)
end

#handle_list(response) ⇒ Object

Methods for parsing JSON response it returns Array of Hash instances



9
10
11
# File 'lib/netologiest/resources/course.rb', line 9

def handle_list(response)
  parse_json(response)
end