Class: RubimCode::UserIO
Overview
class << self
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#pin ⇒ Object
Returns the value of attribute pin.
-
#port ⇒ Object
Returns the value of attribute port.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, port: nil, pin: nil, type: "normal") ⇒ UserIO
constructor
A new instance of UserIO.
Constructor Details
#initialize(name, port: nil, pin: nil, type: "normal") ⇒ UserIO
Returns a new instance of UserIO.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rubimc/io_ports.rb', line 47 def initialize(name, port: nil, pin: nil, type: "normal") # ToDo: check type of params: # name, port - only symbol # pin - only UserVariable with type 'fixed' (feature: pin can receive also instance vars: @pin_num) # type - only 'normal' (feature: realize 'tri-state' type) @name = name.to_s @port = port.to_s @pin = pin.name.to_s @type = type.to_s end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
45 46 47 |
# File 'lib/rubimc/io_ports.rb', line 45 def name @name end |
#pin ⇒ Object
Returns the value of attribute pin.
45 46 47 |
# File 'lib/rubimc/io_ports.rb', line 45 def pin @pin end |
#port ⇒ Object
Returns the value of attribute port.
45 46 47 |
# File 'lib/rubimc/io_ports.rb', line 45 def port @port end |
#type ⇒ Object
Returns the value of attribute type.
45 46 47 |
# File 'lib/rubimc/io_ports.rb', line 45 def type @type end |