Skip to content

Commit

Permalink
Merge pull request #121 from next-tms/brody/add-carrier-implemented
Browse files Browse the repository at this point in the history
Add `Carrier.implemented?`
  • Loading branch information
brodyhoskins authored Jan 25, 2024
2 parents 0ac3da2 + eb0e021 commit 228d564
Showing 1 changed file with 4 additions and 50 deletions.
54 changes: 4 additions & 50 deletions lib/freight_kit/carrier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,12 @@ module FreightKit
# @see #save_request
class Carrier
class << self
# Whether looking up available services is implemented.
# @return [Boolean]
def available_services_implemented?
false
end

# Whether bill of lading (BOL) requires tracking number at time of pickup.
# @return [Boolean]
def bol_requires_tracking_number?
false
end

# Whether canceling a shipment is implemented.
# @return [Boolean]
def cancel_shipment_implemented?
false
end

# Whether creating a pickup is implemented.
# @return [Boolean]
def create_pickup_implemented?
false
end

# The default location to use for {#valid_credentials?}.
# @return [FreightKit::Location]
def default_location
Expand All @@ -55,33 +37,17 @@ def default_location
)
end

# Whether retrieving an existing rate is implemented.
# @return [Boolean]
def find_estimate_implemented?
false
end

# Whether finding rates is implemented.
# @return [Boolean]
def find_rates_implemented?
false
end

# Whether finding rates with declared value (thus insurance) is implemented.
# @return [Boolean]
def find_rates_with_declared_value?
false
end

# Whether retrieving tracking information is implemented.
# @return [Boolean]
def find_tracking_info_implemented?
false
end

# Whether retrieving tracking number from pickup number is implemented.
# Whether instance method is supported
# @return [Boolean]
def find_tracking_number_from_pickup_number_implemented?
def implemented?(instance_method)
instance_method(instance_method).owner != FreightKit::Carrier
rescue NameError
false
end

Expand Down Expand Up @@ -121,12 +87,6 @@ def pickup_number_is_tracking_number?
false
end

# Whether proof of delivery (POD) retrieval is implemented.
# @return [Boolean]
def pod_implemented?
false
end

# Returns the keywords passed to `#initialize` that cannot be blank.
# @return [Array<Symbol>]
def requirements
Expand All @@ -138,12 +98,6 @@ def requirements
def required_credential_types
%i[api]
end

# Whether scanned bill of lading (BOL) retrieval is implemented.
# @return [Boolean]
def scanned_bol_implemented?
false
end
end

attr_accessor :conf, :rates_with_excessive_length_fees, :tmpdir
Expand Down

0 comments on commit 228d564

Please sign in to comment.