Class: OrigenLink::Listener
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- OrigenLink::Listener
- Defined in:
- lib/origen_link/listener.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.environment ⇒ Object
8 9 10 |
# File 'lib/origen_link/listener.rb', line 8 def self.environment @environment || :production end |
.port ⇒ Object
4 5 6 |
# File 'lib/origen_link/listener.rb', line 4 def self.port @port || 20_020 end |
.run!(options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/origen_link/listener.rb', line 16 def self.run!( = {}) @port = [:port] @environment = [:environment] @target_object = [:dut] super end |
.target_object ⇒ Object
12 13 14 |
# File 'lib/origen_link/listener.rb', line 12 def self.target_object @target_object || dut end |
Instance Method Details
#expand_path(path) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/origen_link/listener.rb', line 27 def (path) path.split('.').each do |p| if p =~ /(.*)\[(\d+)(:(\d+))?\]$/ msb = Regexp.last_match(2).to_i lsb = Regexp.last_match(4).to_i if Regexp.last_match(4) yield Regexp.last_match(1) if lsb yield '[]', msb..lsb else yield '[]', msb end else yield p end end end |
#target_object ⇒ Object
23 24 25 |
# File 'lib/origen_link/listener.rb', line 23 def target_object self.class.target_object end |