Class: Elibri::ONIX::Release_3_0::FileInfo
- Inherits:
-
Object
- Object
- Elibri::ONIX::Release_3_0::FileInfo
- Defined in:
- lib/elibri_onix/onix_3_0/file_info.rb
Constant Summary collapse
- ATTRIBUTES =
Informacja o fragmencie publikacji (e-book)
[ :file_type, :file_size, :md5, :updated_at ]
- RELATIONS =
[ :inspect_include_fields ]
Instance Attribute Summary collapse
-
#eid ⇒ Object
Returns the value of attribute eid.
-
#file_size ⇒ Object
Returns the value of attribute file_size.
-
#file_type ⇒ Object
Returns the value of attribute file_type.
-
#md5 ⇒ Object
Returns the value of attribute md5.
-
#to_xml ⇒ Object
Returns the value of attribute to_xml.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(data) ⇒ FileInfo
constructor
A new instance of FileInfo.
- #inspect_include_fields ⇒ Object
Constructor Details
#initialize(data) ⇒ FileInfo
Returns a new instance of FileInfo.
21 22 23 24 25 26 27 28 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 21 def initialize(data) @to_xml = data.to_s @file_type = data.attributes['file_type'].value @file_size = data.attributes['file_size'].value.to_i @md5 = data.attributes['md5'].value @updated_at = Time.parse(data.attributes['updated_at'].value) @eid = data.attributes['id'].value.to_i end |
Instance Attribute Details
#eid ⇒ Object
Returns the value of attribute eid.
19 20 21 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 19 def eid @eid end |
#file_size ⇒ Object
Returns the value of attribute file_size.
19 20 21 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 19 def file_size @file_size end |
#file_type ⇒ Object
Returns the value of attribute file_type.
19 20 21 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 19 def file_type @file_type end |
#md5 ⇒ Object
Returns the value of attribute md5.
19 20 21 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 19 def md5 @md5 end |
#to_xml ⇒ Object
Returns the value of attribute to_xml.
19 20 21 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 19 def to_xml @to_xml end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
19 20 21 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 19 def updated_at @updated_at end |
Instance Method Details
#id ⇒ Object
30 31 32 33 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 30 def id Kernel.warn "[DEPRECATION] `id` is deprecated. Please use `eid` instead." eid end |
#inspect_include_fields ⇒ Object
35 36 37 |
# File 'lib/elibri_onix/onix_3_0/file_info.rb', line 35 def inspect_include_fields [:file_type] end |