Class: TestTrack::OfflineSession
- Inherits:
-
Object
- Object
- TestTrack::OfflineSession
- Defined in:
- app/models/test_track/offline_session.rb
Class Method Summary collapse
- .with_visitor_for(identifier_type, identifier_value, &block) ⇒ Object
- .with_visitor_id(visitor_id, &block) ⇒ Object
Instance Method Summary collapse
-
#initialize(remote_visitor) ⇒ OfflineSession
constructor
A new instance of OfflineSession.
Constructor Details
#initialize(remote_visitor) ⇒ OfflineSession
Returns a new instance of OfflineSession.
2 3 4 |
# File 'app/models/test_track/offline_session.rb', line 2 def initialize(remote_visitor) @remote_visitor = remote_visitor end |
Class Method Details
.with_visitor_for(identifier_type, identifier_value, &block) ⇒ Object
6 7 8 9 10 11 12 |
# File 'app/models/test_track/offline_session.rb', line 6 def self.with_visitor_for(identifier_type, identifier_value, &block) raise ArgumentError, "must provide block to `with_visitor_for`" unless block_given? remote_visitor = TestTrack::Remote::Visitor.from_identifier(identifier_type, identifier_value) new(remote_visitor).send(:manage, &block) end |
.with_visitor_id(visitor_id, &block) ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/models/test_track/offline_session.rb', line 14 def self.with_visitor_id(visitor_id, &block) raise ArgumentError, "must provide block to `with_visitor_id`" unless block_given? remote_visitor = TestTrack::Remote::Visitor.find(visitor_id) new(remote_visitor).send(:manage, &block) end |