Module: RestrictedEnumeration

Included in:
ShipMe::FedEx::AdditionalLabelsType, ShipMe::FedEx::B13AFilingOptionType, ShipMe::FedEx::BarcodeSymbologyType, ShipMe::FedEx::BinaryBarcodeType, ShipMe::FedEx::CarrierCodeType, ShipMe::FedEx::CodAddTransportationChargesType, ShipMe::FedEx::CodCollectionType, ShipMe::FedEx::CodReturnReferenceIndicatorType, ShipMe::FedEx::CustomLabelCoordinateUnits, ShipMe::FedEx::CustomerImageUsageType, ShipMe::FedEx::CustomerReferenceType, ShipMe::FedEx::DangerousGoodsAccessibilityType, ShipMe::FedEx::DayOfWeekType, ShipMe::FedEx::DeletionControlType, ShipMe::FedEx::DestinationControlStatementType, ShipMe::FedEx::DocTabContentType, ShipMe::FedEx::DocTabZoneJustificationType, ShipMe::FedEx::DropoffType, ShipMe::FedEx::EMailNotificationFormatType, ShipMe::FedEx::EMailNotificationRecipientType, ShipMe::FedEx::EdtRequestType, ShipMe::FedEx::EdtTaxType, ShipMe::FedEx::ErrorLabelBehaviorType, ShipMe::FedEx::HazardousCommodityLabelTextOptionType, ShipMe::FedEx::HazardousCommodityOptionType, ShipMe::FedEx::HazardousCommodityPackingGroupType, ShipMe::FedEx::HomeDeliveryPremiumType, ShipMe::FedEx::ImageId, ShipMe::FedEx::InternationalDocumentContentType, ShipMe::FedEx::LabelFormatType, ShipMe::FedEx::LabelMaskableDataType, ShipMe::FedEx::LabelPrintingOrientationType, ShipMe::FedEx::LabelRotationType, ShipMe::FedEx::LabelStockType, ShipMe::FedEx::LinearUnits, ShipMe::FedEx::MinimumChargeType, ShipMe::FedEx::NaftaImporterSpecificationType, ShipMe::FedEx::NaftaNetCostMethodCode, ShipMe::FedEx::NaftaPreferenceCriterionCode, ShipMe::FedEx::NaftaProducerDeterminationCode, ShipMe::FedEx::NaftaProducerSpecificationType, ShipMe::FedEx::NotificationSeverityType, ShipMe::FedEx::OversizeClassType, ShipMe::FedEx::PackageSpecialServiceType, ShipMe::FedEx::PackagingType, ShipMe::FedEx::PaymentType, ShipMe::FedEx::PendingShipmentType, ShipMe::FedEx::PhysicalPackagingType, ShipMe::FedEx::PickupRequestSourceType, ShipMe::FedEx::PickupRequestType, ShipMe::FedEx::PricingCodeType, ShipMe::FedEx::PurposeOfShipmentType, ShipMe::FedEx::RateDimensionalDivisorType, ShipMe::FedEx::RateDiscountType, ShipMe::FedEx::RateRequestType, ShipMe::FedEx::RatedWeightMethod, ShipMe::FedEx::RebateType, ShipMe::FedEx::RecipientCustomsIdType, ShipMe::FedEx::RegulatoryControlType, ShipMe::FedEx::RequestedPackageDetailType, ShipMe::FedEx::RequestedShippingDocumentType, ShipMe::FedEx::ReturnEMailAllowedSpecialServiceType, ShipMe::FedEx::ReturnType, ShipMe::FedEx::ReturnedRateType, ShipMe::FedEx::ReturnedShippingDocumentType, ShipMe::FedEx::ServiceType, ShipMe::FedEx::ShipmentSpecialServiceType, ShipMe::FedEx::ShippingDocumentDispositionType, ShipMe::FedEx::ShippingDocumentEMailGroupingType, ShipMe::FedEx::ShippingDocumentGroupingType, ShipMe::FedEx::ShippingDocumentImageType, ShipMe::FedEx::ShippingDocumentStockType, ShipMe::FedEx::SignatureOptionType, ShipMe::FedEx::SmartPostAncillaryEndorsementType, ShipMe::FedEx::SmartPostIndiciaType, ShipMe::FedEx::SmartPostShipmentSpecialServiceType, ShipMe::FedEx::SpecialRatingAppliedType, ShipMe::FedEx::StringBarcodeType, ShipMe::FedEx::SurchargeLevelType, ShipMe::FedEx::SurchargeType, ShipMe::FedEx::TaxType, ShipMe::FedEx::TermsOfSaleType, ShipMe::FedEx::TinType, ShipMe::FedEx::TrackingIdType, ShipMe::FedEx::TransitTimeType, ShipMe::FedEx::UploadDocumentIdProducer, ShipMe::FedEx::UploadDocumentProducerType, ShipMe::FedEx::UploadDocumentType, ShipMe::FedEx::VariableHandlingChargeType, ShipMe::FedEx::WeightUnits
Defined in:
lib/ship_me/restricted_enumeration.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/ship_me/restricted_enumeration.rb', line 2

def self.included base
  base.class_eval do
    unless roxml_attrs.find { |r| r.attr_name == "value" && r.name == "." }
      xml_accessor :value, :from => :content
    end
  end
  base.extend ClassMethods
end

Instance Method Details

#==(other) ⇒ Object



48
49
50
# File 'lib/ship_me/restricted_enumeration.rb', line 48

def ==(other)
  self.value == other.value
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/ship_me/restricted_enumeration.rb', line 52

def eql?(other)
  self == other && self.class == other.class
end

#initialize(enum = nil) ⇒ Object



44
45
46
# File 'lib/ship_me/restricted_enumeration.rb', line 44

def initialize(enum=nil)
  self.value = enum.value if enum
end