Sha256: a6de00fbe4aadd755d2dfb118551d77e1f0150479f602256826b731d809ef600
Contents?: true
Size: 953 Bytes
Versions: 13
Compression:
Stored size: 953 Bytes
Contents
# frozen_string_literal: true class Acme::Client::Resources::Account attr_reader :url, :status, :contact, :term_of_service, :orders_url def initialize(client, **arguments) @client = client assign_attributes(**arguments) end def kid url end def update(contact: nil, terms_of_service_agreed: nil) assign_attributes(**@client.account_update( contact: contact, terms_of_service_agreed: term_of_service ).to_h) true end def deactivate assign_attributes(**@client.account_deactivate.to_h) true end def reload assign_attributes(**@client.account.to_h) true end def to_h { url: url, term_of_service: term_of_service, status: status, contact: contact } end private def assign_attributes(url:, term_of_service:, status:, contact:) @url = url @term_of_service = term_of_service @status = status @contact = Array(contact) end end
Version data entries
13 entries across 13 versions & 1 rubygems