Class: Spoolprint::ReceiverManager::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/spoolprint/server/receiver_manager.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#flagObject

Returns the value of attribute flag.



16
17
18
# File 'lib/spoolprint/server/receiver_manager.rb', line 16

def flag
  @flag
end

#lengthObject

Returns the value of attribute length.



16
17
18
# File 'lib/spoolprint/server/receiver_manager.rb', line 16

def length
  @length
end

#messageObject

Returns the value of attribute message.



16
17
18
# File 'lib/spoolprint/server/receiver_manager.rb', line 16

def message
  @message
end

Class Method Details

.urai(flag) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/spoolprint/server/receiver_manager.rb', line 26

def self.urai(flag)
  instance = self.new
  if flag == 0x93
    instance.flag = flag
    instance.length = yield(1)
    instance.message = yield(instance.length)
  end
  return instance
end

Instance Method Details

#perfect?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
# File 'lib/spoolprint/server/receiver_manager.rb', line 18

def perfect?
  return false if length.nil?
  return false if length.zero?
  return false if message.nil?
  return false if message.empty?
  return true
end