Skip to content

jmazzi/bike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bike

The wheels on the bicycle goes 'round and 'round.

Usage:

Create a new Bike instance:

  bike = Bike.new

Return a list of bikes as an array of hashes:

  pp bike.list
  
  [{ :bike_id   => 1,
     :owner_id  => 1,
     :name      => 'Bianchi', 
     :parts     => ['frame', 'tires', 'saddle'] },
   { :bike_id   => 2,
     :owner_id  => 2,
     :name      => 'Trek', 
     :parts     => ['frame', 'tires', 'saddle'] }
  ]

Return an array of the parts of a specific bike:

  pp bike.parts(bike_id)
  
  ['frame', 'tires', 'saddle']

Return a hash of bike owner details:

  pp bike.owner(bike_id)
  
  { 
    :id     => 1
    :name   => 'John Doe'
  }

Create a new Person instance

  person = Person.new

Return array of hashes for all people:

  pp person.list
  
  [{ 
    :id     => 1
    :name   => 'John Doe'
  },
  { 
    :id     => 2
    :name   => 'Jane Doe'
  }]

Return hash with details of that person:

  pp person.show(person_id)
  
  { 
    :id     => 1
    :name   => 'John Doe',
  }

About

Don't use this

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages