class ActiveTouch::Network
Attributes
map[RW]
Public Class Methods
new()
click to toggle source
# File lib/active_touch/network.rb, line 15 def initialize @map = {} end
Public Instance Methods
add_touch(caller, touched, watch)
click to toggle source
@param caller [String] @param touched [String, Array(String)] @param watch [Array(Symbol)] @return [void]
# File lib/active_touch/network.rb, line 23 def add_touch(caller, touched, watch) map[caller] ||= [] if touched.is_a? Array touched.each { |t| map[caller] << { class: t, attributes: watch } } else map[caller] << { class: touched, attributes: watch } end end