Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Pet
- def initialize(name, type)
- @name = name
- @type = type
- end
- def name
- p @name
- end
- def type
- p @type
- end
- end
- my_pet = Pet.new("Sparky", "fish")
- my_pet.name
- my_pet.type
- ==>
- "Sparky"
- "fish"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement