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