class BetaBrite::Memory

Constants

COMMAND_CODE
DOTS
LOCKED
STRING
TEXT
UNLOCKED

Attributes

label[RW]
locked[RW]
size[RW]
time[RW]
type[RW]

Public Class Methods

clear() click to toggle source
# File lib/betabrite/memory.rb, line 9
def self.clear
  BetaBrite::Device::STX << COMMAND_CODE
end
new(opts = {}) { |self| ... } click to toggle source
# File lib/betabrite/memory.rb, line 14
def initialize(opts = {})
  args = {  :label  => 'A',
            :type   => STRING,
            :locked => LOCKED,
            :size   => sprintf("%04x", 0),
            :time   => '0000'
          }.merge opts
  @label  = args[:label]
  @type   = args[:type]
  @locked = args[:locked]
  @size   = args[:size]
  @time   = args[:time]
  yield self if block_given?
end

Public Instance Methods

format() click to toggle source
# File lib/betabrite/memory.rb, line 29
def format
  "#{@label}#{@type}#{@locked}#{@size.upcase}#{@time}"
end
Also aliased as: to_s
to_s()
Alias for: format