Class: AVR::Memory::WatchBinding

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/avr/memory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(watch, filter = nil) ⇒ WatchBinding

Returns a new instance of WatchBinding.



54
55
56
57
# File 'lib/avr/memory.rb', line 54

def initialize(watch, filter = nil)
  @watch = watch
  @filter = filter
end

Instance Attribute Details

#filterObject (readonly)

Returns the value of attribute filter.



51
52
53
# File 'lib/avr/memory.rb', line 51

def filter
  @filter
end

#watchObject (readonly)

Returns the value of attribute watch.



48
49
50
# File 'lib/avr/memory.rb', line 48

def watch
  @watch
end

Instance Method Details

#include?(address) ⇒ Boolean

Returns:

  • (Boolean)


60
61
62
63
64
65
66
# File 'lib/avr/memory.rb', line 60

def include?(address)
  if filter
    return true if filter&.include?(address)
    false
  end
  true
end