Class: Edj::Item
- Inherits:
-
Object
- Object
- Edj::Item
- Defined in:
- lib/edj/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Item
constructor
A new instance of Item.
- #timestamp ⇒ Object
Constructor Details
#initialize(hash) ⇒ 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
#timestamp ⇒ Object
23 24 25 |
# File 'lib/edj/base.rb', line 23 def () @raw["timestamp"] end |