Class: Starwars::Person

Inherits:
Base
  • Object
show all
Includes:
Fetcher
Defined in:
lib/starwars/person.rb,
lib/starwars.rb

Overview

A People resource is an individual person or character within the Star Wars universe.

Constant Summary collapse

RESOURCE_NAME =

Define the source name in the starwars api

'people'

Constants inherited from Base

Base::BASE_URL, Base::FORMAT

Instance Method Summary collapse

Methods included from Fetcher

included

Methods inherited from Base

#==, #fetch, fetch

Instance Method Details

#createdTime

Returns:

  • (Time)


30
# File 'lib/starwars/person.rb', line 30

property :created, type: Time

#filmsArray

Returns:

  • (Array)


34
# File 'lib/starwars/person.rb', line 34

collection :films, class: Starwars::Film,  deserialize: ->(_, fragment, _) { Film.new(url: fragment) }

#heightInteger

Returns:

  • (Integer)


23
# File 'lib/starwars/person.rb', line 23

property :height, type: Integer

#homeworldStarwars::Planet

Returns:



27
# File 'lib/starwars/person.rb', line 27

property :homeworld, class: Starwars::Planet, deserialize: ->(_, fragment, _) { Planet.new(url: fragment) }

#nameString

Returns:

  • (String)


14
# File 'lib/starwars/person.rb', line 14

property :name