Class: Tinycms::Authors::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/tinycms/authors/mapper.rb

Class Method Summary collapse

Class Method Details

.map(response_body) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tinycms/authors/mapper.rb', line 6

def self.map(response_body)
  Author.new(
    id: response_body["id"],
    email: response_body["email"],
    first_name: response_body["first_name"],
    last_name: response_body["last_name"],
    full_name: response_body["full_name"],
    title: response_body["title"],
    slug: response_body["slug"],
    avatar_url: response_body["avatar_url"],
    created_at: Time.zone.parse(response_body["created_at"]),
    updated_at: Time.zone.parse(response_body["updated_at"])
  )
end