Class: TRMNL::API::Endpoints::Category

Inherits:
Object
  • Object
show all
Includes:
Pipeable
Defined in:
lib/trmnl/api/endpoints/category.rb

Overview

Handles API request/response.

Instance Method Summary collapse

Instance Method Details

#callObject



16
17
18
19
20
21
22
23
# File 'lib/trmnl/api/endpoints/category.rb', line 16

def call
  pipe(
    requester.get("categories"),
    try(:parse, catch: JSON::ParserError),
    validate(schema, as: :to_h),
    as(:fetch, :data)
  )
end