Class: Cradlepoint::Account
- Inherits:
-
CradlepointObject
- Object
- CradlepointObject
- Cradlepoint::Account
- Defined in:
- lib/cradlepoint/account.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#disabled ⇒ Object
Returns the value of attribute disabled.
-
#ecm_id ⇒ Object
Returns the value of attribute ecm_id.
-
#expiration ⇒ Object
Returns the value of attribute expiration.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(id = nil) ⇒ Account
constructor
A new instance of Account.
- #lazy_load_id ⇒ Object
- #rel_url ⇒ Object
- #rel_url_with_id ⇒ Object
Methods inherited from CradlepointObject
build_new_url, #build_new_url, #build_url, build_url, #params
Constructor Details
#initialize(id = nil) ⇒ Account
Returns a new instance of Account.
6 7 8 |
# File 'lib/cradlepoint/account.rb', line 6 def initialize(id = nil) self.ecm_id = id end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/cradlepoint/account.rb', line 4 def data @data end |
#disabled ⇒ Object
Returns the value of attribute disabled.
4 5 6 |
# File 'lib/cradlepoint/account.rb', line 4 def disabled @disabled end |
#ecm_id ⇒ Object
Returns the value of attribute ecm_id.
4 5 6 |
# File 'lib/cradlepoint/account.rb', line 4 def ecm_id @ecm_id end |
#expiration ⇒ Object
Returns the value of attribute expiration.
4 5 6 |
# File 'lib/cradlepoint/account.rb', line 4 def expiration @expiration end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/cradlepoint/account.rb', line 4 def name @name end |
Class Method Details
.rel_url ⇒ Object
10 11 12 |
# File 'lib/cradlepoint/account.rb', line 10 def self.rel_url '/accounts' end |
.rel_url_with_id(id) ⇒ Object
18 19 20 |
# File 'lib/cradlepoint/account.rb', line 18 def self.rel_url_with_id(id) "#{ rel_url }/#{ id }/" end |
Instance Method Details
#id ⇒ Object
26 27 28 |
# File 'lib/cradlepoint/account.rb', line 26 def id self.ecm_id ? self.ecm_id : lazy_load_id end |
#lazy_load_id ⇒ Object
30 31 32 33 34 |
# File 'lib/cradlepoint/account.rb', line 30 def lazy_load_id self.data = Cradlepoint.make_request(:get, build_url(rel_url)) self.ecm_id = self.data[0][:id] self.ecm_id end |
#rel_url ⇒ Object
14 15 16 |
# File 'lib/cradlepoint/account.rb', line 14 def rel_url Cradlepoint::Account.rel_url end |
#rel_url_with_id ⇒ Object
22 23 24 |
# File 'lib/cradlepoint/account.rb', line 22 def rel_url_with_id Cradlepoint::Account.rel_url_with_id(id) end |