Advertisement
Guest User

Untitled

a guest
Dec 21st, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.21 KB | None | 0 0
  1. class Probe
  2.     @next_probe_id = 0
  3.  
  4.     def self.next_probe_id
  5.         @next_probe_id += 1
  6.     end
  7.  
  8.     attr_reader :id
  9.  
  10.     def initialize
  11.         @id = Probe.next_probe_id
  12.     end
  13.  
  14.     def name
  15.         @name ||= "Probe #{id}"
  16.     end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement