lib/rixml.rb in rixml-0.1.6 vs lib/rixml.rb in rixml-0.2.0
- old
+ new
@@ -19,13 +19,28 @@
def product_id
@attrs.dig('Research', 'Product', 'productID')
end
+ def research_id
+ @attrs.dig('Research', 'researchID')
+ end
+
+ # @deprecated Please use {#status_info} instead
def status
current_status_info&.dig('statusType')&.downcase&.to_sym || :published
end
+ def status_info
+ time_str = current_status_info&.dig('statusDateTime') || DateTime.now.to_s
+ status = current_status_info&.dig('statusType')&.downcase&.to_sym || :published
+ {
+ status: status,
+ date: Time.parse(time_str).to_datetime.to_s
+ }
+ end
+
+ # @deprecated Please use {#status_info} instead
def publication_date
time_str = current_status_info&.dig('statusDateTime') || DateTime.now.to_s
Time.parse(time_str).to_datetime.to_s
end