Class: Starwars::Person
- Inherits:
-
Base
- Object
- OpenStruct
- Base
- Starwars::Person
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
#created ⇒ Time
30
|
# File 'lib/starwars/person.rb', line 30
property :created, type: Time
|
#films ⇒ Array
34
|
# File 'lib/starwars/person.rb', line 34
collection :films, class: Starwars::Film, deserialize: ->(_, fragment, _) { Film.new(url: fragment) }
|
#height ⇒ Integer
23
|
# File 'lib/starwars/person.rb', line 23
property :height, type: Integer
|
27
|
# File 'lib/starwars/person.rb', line 27
property :homeworld, class: Starwars::Planet, deserialize: ->(_, fragment, _) { Planet.new(url: fragment) }
|
#name ⇒ String
14
|
# File 'lib/starwars/person.rb', line 14
property :name
|