Class: ZplScaler::ZplCommand
- Inherits:
-
Object
- Object
- ZplScaler::ZplCommand
- Defined in:
- lib/zpl-scaler.rb
Overview
Data class that holds the name & params of a ZPL command.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(name, params) ⇒ ZplCommand
constructor
A new instance of ZplCommand.
-
#to_zpl_string ⇒ Object
Converts the command to a ZPL string.
Constructor Details
#initialize(name, params) ⇒ ZplCommand
Returns a new instance of ZplCommand.
14 15 16 17 |
# File 'lib/zpl-scaler.rb', line 14 def initialize(name, params) @name = name @params = params end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/zpl-scaler.rb', line 11 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
12 13 14 |
# File 'lib/zpl-scaler.rb', line 12 def params @params end |
Instance Method Details
#to_zpl_string ⇒ Object
Converts the command to a ZPL string.
20 21 22 |
# File 'lib/zpl-scaler.rb', line 20 def to_zpl_string "^#{ @name }#{ @params.join(',') }" end |