Class: Brick
- Inherits:
-
Object
- Object
- Brick
- Defined in:
- lib/brick.rb
Overview
Abstract parent class of motor and sensor bricks. Currently provides only very basic common functionality but may be expanded in the future.
Instance Attribute Summary collapse
-
#log ⇒ Object
readonly
Returns the value of attribute log.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(nxt, port) ⇒ Brick
constructor
A new instance of Brick.
Constructor Details
#initialize(nxt, port) ⇒ Brick
Returns a new instance of Brick.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/brick.rb', line 31 def initialize(nxt, port) logfile = File.(File.dirname(File.(__FILE__)))+"/../log/#{self.class}_#{port}.log" @log = Logger.new logfile @log.level = Logger::DEBUG #puts "Logging to #{logfile}" debug("#{self.class}::#{nxt}(#{port})", :initialize) @nxt = nxt end |
Instance Attribute Details
#log ⇒ Object (readonly)
Returns the value of attribute log.
29 30 31 |
# File 'lib/brick.rb', line 29 def log @log end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
28 29 30 |
# File 'lib/brick.rb', line 28 def port @port end |