From fc456f7b034e59641abb3a950be25d8a5c66b597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 25 May 2012 15:08:36 +0200 Subject: Particle: add #init! which sets @src and @ts --- lib/iotas/particle.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/iotas/particle.rb b/lib/iotas/particle.rb index 4141953..e723676 100644 --- a/lib/iotas/particle.rb +++ b/lib/iotas/particle.rb @@ -76,16 +76,19 @@ module Iotas end # def reset! - @ts = Time.now - @src = @dst = @room = @door = @action = @link_value = nil + @ts = @src = @dst = @room = @door = @action = @link_value = nil @dsts.clear @link_fields.clear @payload.clear @merged.clear end # - attr_accessor :src - attr_reader :ts, :dst, :room, :door, :action, :link_value, :payload + def init! src + @src = src + @ts = Time.now + end + # + attr_reader :ts, :src, :dst, :room, :door, :action, :link_value, :payload # # routing # -- cgit v1.1-2-g2b99