Class: Driver::Epson::Fiscal::Frame

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
app/models/extface/driver/epson/fiscal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bccObject (readonly)

Returns the value of attribute bcc.



88
89
90
# File 'app/models/extface/driver/epson/fiscal.rb', line 88

def bcc
  @bcc
end

#cmdObject (readonly)

Returns the value of attribute cmd.



88
89
90
# File 'app/models/extface/driver/epson/fiscal.rb', line 88

def cmd
  @cmd
end

#fieldsObject (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_dataObject (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

#frameObject (readonly)

Returns the value of attribute frame.



88
89
90
# File 'app/models/extface/driver/epson/fiscal.rb', line 88

def frame
  @frame
end

#seqObject (readonly)

Returns the value of attribute seq.



88
89
90
# File 'app/models/extface/driver/epson/fiscal.rb', line 88

def seq
  @seq
end