Class: Pantry::ClientRegistry::ClientRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/pantry/client_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClientRecord

Returns a new instance of ClientRecord.



88
89
90
91
# File 'lib/pantry/client_registry.rb', line 88

def initialize
  @client = nil
  @last_checked_in_at = nil
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



86
87
88
# File 'lib/pantry/client_registry.rb', line 86

def client
  @client
end

#last_checked_in_atObject (readonly)

Returns the value of attribute last_checked_in_at.



86
87
88
# File 'lib/pantry/client_registry.rb', line 86

def last_checked_in_at
  @last_checked_in_at
end

Instance Method Details

#check_in(client) ⇒ Object



93
94
95
96
# File 'lib/pantry/client_registry.rb', line 93

def check_in(client)
  @client = client
  @last_checked_in_at = Time.now
end

#checked_in?Boolean

Returns:

  • (Boolean)


98
99
100
# File 'lib/pantry/client_registry.rb', line 98

def checked_in?
  !@last_checked_in_at.nil?
end