Class: Acme::Client::Resources::Account
- Inherits:
-
Object
- Object
- Acme::Client::Resources::Account
- Defined in:
- lib/acme/client/resources/account.rb
Instance Attribute Summary collapse
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
-
#orders_url ⇒ Object
readonly
Returns the value of attribute orders_url.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#term_of_service ⇒ Object
readonly
Returns the value of attribute term_of_service.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #deactivate ⇒ Object
-
#initialize(client, **arguments) ⇒ Account
constructor
A new instance of Account.
- #kid ⇒ Object
- #reload ⇒ Object
- #to_h ⇒ Object
- #update(contact: nil, terms_of_service_agreed: nil) ⇒ Object
Constructor Details
#initialize(client, **arguments) ⇒ Account
Returns a new instance of Account.
6 7 8 9 |
# File 'lib/acme/client/resources/account.rb', line 6 def initialize(client, **arguments) @client = client assign_attributes(**arguments) end |
Instance Attribute Details
#contact ⇒ Object (readonly)
Returns the value of attribute contact.
4 5 6 |
# File 'lib/acme/client/resources/account.rb', line 4 def contact @contact end |
#orders_url ⇒ Object (readonly)
Returns the value of attribute orders_url.
4 5 6 |
# File 'lib/acme/client/resources/account.rb', line 4 def orders_url @orders_url end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/acme/client/resources/account.rb', line 4 def status @status end |
#term_of_service ⇒ Object (readonly)
Returns the value of attribute term_of_service.
4 5 6 |
# File 'lib/acme/client/resources/account.rb', line 4 def term_of_service @term_of_service end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/acme/client/resources/account.rb', line 4 def url @url end |
Instance Method Details
#deactivate ⇒ Object
22 23 24 25 |
# File 'lib/acme/client/resources/account.rb', line 22 def deactivate assign_attributes(**@client.account_deactivate.to_h) true end |
#kid ⇒ Object
11 12 13 |
# File 'lib/acme/client/resources/account.rb', line 11 def kid url end |
#reload ⇒ Object
27 28 29 30 |
# File 'lib/acme/client/resources/account.rb', line 27 def reload assign_attributes(**@client.account.to_h) true end |
#to_h ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/acme/client/resources/account.rb', line 32 def to_h { url: url, term_of_service: term_of_service, status: status, contact: contact } end |
#update(contact: nil, terms_of_service_agreed: nil) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/acme/client/resources/account.rb', line 15 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 |