class Braintree::CustomerRecommendations
Attributes
Public Class Methods
Source
# File lib/braintree/graphql/unions/customer_recommendations.rb, line 42 def _new(attributes = {}) new(attributes) end
Source
# File lib/braintree/graphql/unions/customer_recommendations.rb, line 11 def initialize(attributes = {}) @payment_recommendations = initialize_payment_recommendations(attributes[:payment_recommendations]) # Always derive payment_options from payment_recommendations @payment_options = @payment_recommendations.map do |recommendation| PaymentOptions._new( paymentOption: recommendation.payment_option, recommendedPriority: recommendation.recommended_priority, ) end end
Public Instance Methods
Source
# File lib/braintree/graphql/unions/customer_recommendations.rb, line 23 def inspect "#<#{self.class} payment_options: #{payment_options.inspect}, payment_recommendations: #{payment_recommendations.inspect}>" end
Private Instance Methods
Source
# File lib/braintree/graphql/unions/customer_recommendations.rb, line 29 def initialize_payment_recommendations(payment_recommendations) return [] if payment_recommendations.nil? payment_recommendations.map do |recommendation_hash| if recommendation_hash.is_a?(PaymentRecommendations) recommendation_hash else PaymentRecommendations._new(recommendation_hash) end end end