Class: RegistersClient::Item
- Inherits:
-
Object
- Object
- RegistersClient::Item
- Defined in:
- lib/item.rb
Instance Method Summary collapse
- #has_end_date ⇒ Object
- #hash ⇒ Object
-
#initialize(rsf_line) ⇒ Item
constructor
A new instance of Item.
- #value ⇒ Object
Constructor Details
#initialize(rsf_line) ⇒ Item
Returns a new instance of Item.
5 6 7 8 9 10 |
# File 'lib/item.rb', line 5 def initialize(rsf_line) @item_json = rsf_line.split("\t")[1] @item_hash = 'sha-256:' + Digest::SHA256.hexdigest(@item_json) @parsed_item = nil end |
Instance Method Details
#has_end_date ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/item.rb', line 20 def has_end_date if !@item_json.nil? !@item_json.index("end-date").nil? else !@parsed_item['end-date'].nil? end end |
#hash ⇒ Object
12 13 14 |
# File 'lib/item.rb', line 12 def hash @item_hash end |
#value ⇒ Object
16 17 18 |
# File 'lib/item.rb', line 16 def value get_item end |