Class: Starwars::Starship

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

Overview

A Film resource is an single film.

Constant Summary collapse

RESOURCE_NAME =

Define the source name in the starwars api

'starships'

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

#cost_in_creditsInteger

Returns:

  • (Integer)


21
# File 'lib/starwars/starship.rb', line 21

property :cost_in_credits, type: Integer

#createdTime

Returns:

  • (Time)


33
# File 'lib/starwars/starship.rb', line 33

property :created, type: Time

#hyperdrive_ratingFloat

Returns:

  • (Float)


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

property :hyperdrive_rating, type: Float

#nameString

Returns:

  • (String)


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

property :name

#pilotsArray

Returns:

  • (Array)


37
# File 'lib/starwars/starship.rb', line 37

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