diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-25 15:08:36 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-25 15:08:36 +0200 |
commit | fc456f7b034e59641abb3a950be25d8a5c66b597 (patch) | |
tree | 3241ca16cde1a749dedbc7b4ba459bc56d73e34c /lib/iotas/particle.rb | |
parent | f75f315d511c0de8cddb00ac1077ca35cfee5517 (diff) | |
download | edoors-ruby-fc456f7b034e59641abb3a950be25d8a5c66b597.zip edoors-ruby-fc456f7b034e59641abb3a950be25d8a5c66b597.tar.gz |
Particle: add #init! which sets @src and @ts
Diffstat (limited to 'lib/iotas/particle.rb')
-rw-r--r-- | lib/iotas/particle.rb | 11 |
1 files 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 # |