Class: WIS::DOM::Issue

Inherits:
Object
  • Object
show all
Defined in:
lib/dom/issue.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/dom/issue.rb', line 3

def description
  @description
end

#idObject (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