Class: Driver::Epson::Fiscal::Frame
- Inherits:
-
Object
- Object
- Driver::Epson::Fiscal::Frame
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/extface/driver/epson/fiscal.rb
Instance Attribute Summary collapse
-
#bcc ⇒ Object
readonly
Returns the value of attribute bcc.
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#fields_data ⇒ Object
readonly
Returns the value of attribute fields_data.
-
#frame ⇒ Object
readonly
Returns the value of attribute frame.
-
#seq ⇒ Object
readonly
Returns the value of attribute seq.
Instance Method Summary collapse
-
#initialize(buffer) ⇒ Frame
constructor
A new instance of Frame.
Constructor Details
#initialize(buffer) ⇒ Frame
Returns a new instance of Frame.
90 91 92 93 94 95 96 |
# File 'app/models/extface/driver/epson/fiscal.rb', line 90 def initialize(buffer) if match = buffer.match(/\x02([\x20-\x7F])([\x30-\xaf])\x1c(.*)\x03(.{4})/n) @frame = match.to_a.first @seq, @cmd, @fileds_data, @bcc = match.captures @fields = @fields_data.split("\x1c") end end |
Instance Attribute Details
#bcc ⇒ Object (readonly)
Returns the value of attribute bcc.
88 89 90 |
# File 'app/models/extface/driver/epson/fiscal.rb', line 88 def bcc @bcc end |
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
88 89 90 |
# File 'app/models/extface/driver/epson/fiscal.rb', line 88 def cmd @cmd end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
88 89 90 |
# File 'app/models/extface/driver/epson/fiscal.rb', line 88 def fields @fields end |
#fields_data ⇒ Object (readonly)
Returns the value of attribute fields_data.
88 89 90 |
# File 'app/models/extface/driver/epson/fiscal.rb', line 88 def fields_data @fields_data end |
#frame ⇒ Object (readonly)
Returns the value of attribute frame.
88 89 90 |
# File 'app/models/extface/driver/epson/fiscal.rb', line 88 def frame @frame end |
#seq ⇒ Object (readonly)
Returns the value of attribute seq.
88 89 90 |
# File 'app/models/extface/driver/epson/fiscal.rb', line 88 def seq @seq end |