From a0c9834b44afb7177e5175f2f6df72005b62a9e6 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 23 Feb 2021 22:15:54 -0500 Subject: [PATCH] Rubocop fixes --- .rubocop.yml | 3 +++ sgx_jmp.rb | 30 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 67d9c1a..fc5aa5b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -40,3 +40,6 @@ Style/MultilineBlockChain: Layout/IndentArray: EnforcedStyle: consistent + +Style/FormatString: + EnforcedStyle: percent diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 4e28908..2302880 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -44,7 +44,7 @@ class AsyncBraintree end def method_missing(m, *args) - return super if false # cover everything for now + return super if respond_to_missing?(m, *args) self.then { |o| o.public_send(m, *args) } end end @@ -330,19 +330,21 @@ command :execute?, node: "buy-credit", sessionid: nil do |iq| type: "fixed", value: "Current balance: $#{'%.2f' % balance}" }, - ({ - var: "payment_method", - type: "list-single", - label: "Credit card to pay with", - value: default_payment_method.to_s, - required: true, - options: payment_methods.map.with_index do |method, idx| - { - value: idx.to_s, - label: "#{method.card_type} #{method.last_4}" - } - end - } if payment_methods.length > 1), + if payment_methods.length > 1 + { + var: "payment_method", + type: "list-single", + label: "Credit card to pay with", + value: default_payment_method.to_s, + required: true, + options: payment_methods.map.with_index do |method, idx| + { + value: idx.to_s, + label: "#{method.card_type} #{method.last_4}" + } + end + } + end, XEP0122Field.new( "xs:decimal", range: (0..1000), -- 2.34.2