Class: Edj::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/edj/base.rb

Direct Known Subclasses

EngineerItem, ScanItem

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Item

Returns a new instance of Item.



19
20
21
# File 'lib/edj/base.rb', line 19

def initialize(hash)
	@raw = hash
end

Class Method Details

.from(hash) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/edj/base.rb', line 8

def self.from(hash)
	case hash["event"]
	when "Scan"
		ScanItem.new(hash)
	when "EngineerProgress"
		EngineerProgressItem.new(hash)
	when "EngineerContributionItem"
		EngineerContributionItem.new(hash)
	end
end

Instance Method Details

#timestampObject



23
24
25
# File 'lib/edj/base.rb', line 23

def timestamp()
	@raw["timestamp"]
end