Class: Trackerific::Base
- Inherits:
-
Object
- Object
- Trackerific::Base
- Defined in:
- lib/trackerific.rb
Overview
Base class for Trackerific tracking services.
Instance Method Summary (collapse)
-
- (Base) initialize(options = {})
constructor
A new instance of Base.
-
- (Array) required_options
Override this method if your subclass has required options.
-
- (Hash) track_package(package_id)
Override this method in your subclass to implement tracking a package.
Constructor Details
- (Base) initialize(options = {})
A new instance of Base
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/trackerific.rb', line 12 def initialize( = {}) required = required.each do |k| raise ArgumentError.new("Missing required parameter: #{k}") unless .has_key?(k) end .each do |k, v| raise ArgumentError.new("Invalid parameter: #{k}") unless required.include?(k) end @options = end |
Instance Method Details
- (Array) required_options
Override this method if your subclass has required options.
25 26 27 |
# File 'lib/trackerific.rb', line 25 def [] end |
- (Hash) track_package(package_id)
Override this method in your subclass to implement tracking a package.
31 32 33 |
# File 'lib/trackerific.rb', line 31 def track_package(package_id) @package_id = package_id end |