~singpolyma/sgx-jmp

e956460d18da996b93efeedf326d582fc3ebc3a4 — Stephen Paul Weber 1 year, 3 months ago 3a0f5bf
Use Forwardable for simple delegations
1 files changed, 6 insertions(+), 11 deletions(-)

M lib/customer.rb
M lib/customer.rb => lib/customer.rb +6 -11
@@ 1,5 1,7 @@
# frozen_string_literal: true

require "forwardable"

require_relative "./ibr"
require_relative "./payment_methods"
require_relative "./plan"


@@ 23,7 25,11 @@ class Customer
		end
	end

	extend Forwardable

	attr_reader :customer_id, :balance
	def_delegator :@plan, :name, :plan_name
	def_delegators :@plan, :currency, :merchant_account

	def initialize(
		customer_id,


@@ 46,17 52,6 @@ class Customer
		)
	end

	def plan_name
		@plan.name
	end

	def currency
		@plan.currency
	end

	def merchant_account
		@plan.merchant_account
	end

	def payment_methods
		@payment_methods ||=