Sha256: e7169edc099f8270ae2ebbdccf6a401cc75cabba965e69858da4046ed5126321
Contents?: true
Size: 1.07 KB
Versions: 2
Compression:
Stored size: 1.07 KB
Contents
require 'rint_core/g_code/codes' require 'active_support/core_ext/object/blank' module RintCore module Driver module State def can_print? connected? && online? && !printing? end def connected? @connection.present? end def clear_to_send? @clear && online? end def listen_can_continue? !@stop_listening && connected? end def online? connected? && @online end def paused? @paused end def printing? @printing end private def initialize_state @clear = false @online = false @printing = false @paused = false @stop_listening = false end def clear_to_send! @clear = true end def not_clear_to_send! @clear = false end def online! @online = true end def offline! @online = false end def printing! @printing = true end def not_printing! @printing = false end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rintcore-0.0.3 | lib/rint_core/driver/state.rb |
rintcore-0.0.2 | lib/rint_core/driver/state.rb |