~singpolyma/sgx-jmp

92d5648358ce2939f9dae1e26182e2055bdc8781 — Stephen Paul Weber 1 year, 11 days ago 05a8753
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 ||=