Class: BerkeleyLibrary::Location::XLSXWriter
- Inherits:
-
Object
- Object
- BerkeleyLibrary::Location::XLSXWriter
- Includes:
- Constants, BerkeleyLibrary::Logging
- Defined in:
- lib/berkeley_library/location/xlsx_writer.rb
Constant Summary collapse
- COL_SLFN =
'SLFN'.freeze
- COL_SLFS =
'SLFS'.freeze
- COL_OTHER_UC =
'Other UC'.freeze
- COL_WC_ERROR =
'WorldCat Error'.freeze
- COL_HATHI_TRUST =
'Hathi Trust'.freeze
- COL_HATHI_TRUST_ERROR =
"#{COL_HATHI_TRUST} Error".freeze
- V_SLFN =
'slfn'.freeze
- V_SLFS =
'slfs'.freeze
Constants included from Constants
Instance Attribute Summary collapse
-
#hathi_trust ⇒ Object
readonly
Returns the value of attribute hathi_trust.
-
#slf ⇒ Object
readonly
Returns the value of attribute slf.
-
#ss ⇒ Object
readonly
Returns the value of attribute ss.
-
#uc ⇒ Object
readonly
Returns the value of attribute uc.
Instance Method Summary collapse
- #<<(result) ⇒ Object
-
#initialize(ss, slf: true, uc: true, hathi_trust: true) ⇒ XLSXWriter
constructor
A new instance of XLSXWriter.
Constructor Details
#initialize(ss, slf: true, uc: true, hathi_trust: true) ⇒ XLSXWriter
Returns a new instance of XLSXWriter.
23 24 25 26 27 28 29 30 |
# File 'lib/berkeley_library/location/xlsx_writer.rb', line 23 def initialize(ss, slf: true, uc: true, hathi_trust: true) @ss = ss @slf = slf @uc = uc @hathi_trust = hathi_trust ensure_columns! end |
Instance Attribute Details
#hathi_trust ⇒ Object (readonly)
Returns the value of attribute hathi_trust.
21 22 23 |
# File 'lib/berkeley_library/location/xlsx_writer.rb', line 21 def hathi_trust @hathi_trust end |
#slf ⇒ Object (readonly)
Returns the value of attribute slf.
21 22 23 |
# File 'lib/berkeley_library/location/xlsx_writer.rb', line 21 def slf @slf end |
#ss ⇒ Object (readonly)
Returns the value of attribute ss.
21 22 23 |
# File 'lib/berkeley_library/location/xlsx_writer.rb', line 21 def ss @ss end |
#uc ⇒ Object (readonly)
Returns the value of attribute uc.
21 22 23 |
# File 'lib/berkeley_library/location/xlsx_writer.rb', line 21 def uc @uc end |
Instance Method Details
#<<(result) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/berkeley_library/location/xlsx_writer.rb', line 32 def <<(result) r_indices = row_indices_for(result.oclc_number) r_indices.each do |idx| write_wc_cols(idx, result) if slf || uc write_ht_cols(idx, result) if hathi_trust end end |