Class: LadderConverter::KvCode
- Defined in:
- lib/ladder_converter/kv_code.rb
Instance Attribute Summary
Attributes inherited from PlcCode
Instance Method Summary collapse
- #becone_subroutin_label ⇒ Object
-
#initialize(mnemonic, devices) ⇒ KvCode
constructor
A new instance of KvCode.
- #to_s ⇒ Object
Methods inherited from PlcCode
Constructor Details
#initialize(mnemonic, devices) ⇒ KvCode
Returns a new instance of KvCode.
8 9 10 11 12 13 14 |
# File 'lib/ladder_converter/kv_code.rb', line 8 def initialize mnemonic, devices super case self.mnemonic when 'LABEL' @devices = [own_device(mnemonic)] end end |
Instance Method Details
#becone_subroutin_label ⇒ Object
16 17 18 |
# File 'lib/ladder_converter/kv_code.rb', line 16 def becone_subroutin_label @mnemonic = 'SBN' end |
#to_s ⇒ Object
20 21 22 23 |
# File 'lib/ladder_converter/kv_code.rb', line 20 def to_s return mnemonic if devices.empty? ([mnemonic] + devices).join(" ") end |