Class: WIS::DOM::Account
- Inherits:
-
Object
- Object
- WIS::DOM::Account
- Defined in:
- lib/dom/account.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, name, description) ⇒ Account
constructor
A new instance of Account.
Constructor Details
#initialize(id, name, description) ⇒ Account
Returns a new instance of Account.
5 6 7 8 9 |
# File 'lib/dom/account.rb', line 5 def initialize(id, name, description) @id = id @name = name @description = description end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/dom/account.rb', line 3 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/dom/account.rb', line 2 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/dom/account.rb', line 2 def name @name end |
Class Method Details
.adapt_json(data) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dom/account.rb', line 11 def self.adapt_json(data) if data.kind_of?(Array) accounts = [] data.each do |a| accounts << WIS::DOM::Account.new(a["ID"], a["Name"], a["Description"]) end accounts else WIS::DOM::Account.new(data["ID"], data["Name"], data["Description"]) end end |