2222
2323module SoftLayer
2424 class Account < SoftLayer ::ModelBase
25- include ::SoftLayer ::ModelResource
26-
27- softlayer_attr :companyName
28- softlayer_attr :firstName
29- softlayer_attr :lastName
30- softlayer_attr :address1
31- softlayer_attr :address2
32- softlayer_attr :city
33- softlayer_attr :state
34- softlayer_attr :country
35- softlayer_attr :postalCode
36- softlayer_attr :officePhone
25+ include ::SoftLayer ::DynamicAttribute
26+
27+ ##
28+ # :attr_reader:
29+ # The company name of the primary contact
30+ sl_attr :companyName
31+
32+ ##
33+ # :attr_reader:
34+ # The given name name of the primary contact
35+ sl_attr :firstName
36+
37+ ##
38+ # :attr_reader:
39+ # The surname of the primary contact
40+ sl_attr :lastName
41+
42+ ##
43+ # :attr_reader:
44+ # The first address line for the primary contact's address
45+ sl_attr :address1
46+
47+ ##
48+ # :attr_reader:
49+ # The second address line (if any, may be nil) for the primary contact's address
50+ sl_attr :address2
51+
52+ ##
53+ # :attr_reader:
54+ # The city stored as part of the primary contact's address
55+ sl_attr :city
56+
57+ ##
58+ # :attr_reader:
59+ # The two character abbreviation for the state, province, or other similar national
60+ # division that is part of the address of the primary contact. For addresses
61+ # outside of the US and Canada, where there may not be an equivalent to a state,
62+ # this may be 'NA' (for not applicable)
63+ sl_attr :state
64+
65+ ##
66+ # :attr_reader:
67+ # The country stored as part of the primary contact's address
68+ sl_attr :country
69+
70+ ##
71+ # :attr_reader:
72+ # The postal code (in the US, aka. zip code) of the primary contact's address
73+ sl_attr :postalCode
74+
75+ ##
76+ # :attr_reader:
77+ # The office phone nubmer listed for the primary contact
78+ sl_attr :officePhone
3779
3880 ##
3981 # The Bare Metal Servers (physical hardware) associated with the
4082 # account. Unless you force these to update, they will be refreshed every
4183 # five minutes.
42- softlayer_resource :bare_metal_servers do |bare_metal |
84+ # :call-seq:
85+ # bare_metal_servers(force_update=false)
86+ sl_dynamic_attr :bare_metal_servers do |bare_metal |
4387 bare_metal . should_update? do
4488 @last_bare_metal_update ||= Time . at ( 0 )
4589 ( Time . now - @last_bare_metal_update ) > 5 * 60 # update every 5 minutes
@@ -55,7 +99,9 @@ class Account < SoftLayer::ModelBase
5599 # The virtual servers (aka. CCIs or Virtual_Guests) associated with the
56100 # account. Unless you force these to update, they will be refreshed every
57101 # five minutes.
58- softlayer_resource :virtual_servers do |virtual_servers |
102+ # :call-seq:
103+ # virtual_servers(force_update=false)
104+ sl_dynamic_attr :virtual_servers do |virtual_servers |
59105 virtual_servers . should_update? do
60106 @last_virtual_server_update ||= Time . at ( 0 )
61107 ( Time . now - @last_virtual_server_update ) > 5 * 60 # update every 5 minutes
@@ -69,8 +115,10 @@ class Account < SoftLayer::ModelBase
69115
70116 ##
71117 # The tickets resource consists of all open tickets, and tickets closed
72- # "recently". These refresh every 5 minutes
73- softlayer_resource :tickets do |tickets |
118+ # "recently". These refresh every 5 minutes.
119+ # :call-seq:
120+ # tickets(force_update=false)
121+ sl_dynamic_attr :tickets do |tickets |
74122 tickets . should_update? do
75123 @last_ticket_update ||= Time . at ( 0 )
76124 ( Time . now - @last_ticket_update ) > 5 * 60 #update every 5 minutes
0 commit comments