Class: Trackerific::Base
- Inherits:
-
Object
- Object
- Trackerific::Base
- Defined in:
- lib/trackerific.rb
Overview
Base class for Trackerific package tracking services.
Instance Method Summary (collapse)
-
- (Base) initialize(options = {})
constructor
Private
Creates a new instance of Trackerific::Base with required options.
-
- (Trackerific::Details) track_package(package_id)
Gets the tracking information for the package from the server.
Constructor Details
- (Base) initialize(options = {})
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new instance of Trackerific::Base with required options
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/trackerific.rb', line 14 def initialize( = {}) required = # make sure all the required options exist required.each do |k| raise ArgumentError.new("Missing required parameter: #{k}") unless .has_key?(k) end # make sure no invalid options exist .each do |k, v| raise ArgumentError.new("Invalid parameter: #{k}") unless required.include?(k) end @options = end |
Instance Method Details
- (Trackerific::Details) track_package(package_id)
Gets the tracking information for the package from the server
42 43 44 |
# File 'lib/trackerific.rb', line 42 def track_package(package_id) @package_id = package_id end |