Class: ZplScaler::ZplCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/zpl-scaler.rb

Overview

Data class that holds the name & params of a ZPL command.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/zpl-scaler.rb', line 11

def name
  @name
end

#paramsObject

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_stringObject

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