Advertisement
Guest User

Untitled

a guest
Aug 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.29 KB | None | 0 0
  1. class Product
  2.   attr_accessor :price, :quantity
  3.  
  4.   def initialize(param)
  5.     @price = param[:price]
  6.     @quantity =param[:quantity]
  7.   end
  8.  
  9.   def to_s
  10.     "#{@price} рублей  В наличии - #{@quantity}"
  11.   end
  12.  
  13.   def self.from_file(file_path)
  14.     NotImplementedError
  15.   end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement