Class: BerkeleyLibrary::Location::LocationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/berkeley_library/location/location_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(oclc_number, wc_symbols: [], wc_error: nil, ht_record_url: nil, ht_error: nil) ⇒ LocationResult

Returns a new instance of LocationResult.



8
9
10
11
12
13
14
# File 'lib/berkeley_library/location/location_result.rb', line 8

def initialize(oclc_number, wc_symbols: [], wc_error: nil, ht_record_url: nil, ht_error: nil)
  @oclc_number = oclc_number
  @wc_symbols = wc_symbols
  @wc_error = wc_error
  @ht_record_url = ht_record_url
  @ht_error = ht_error
end

Instance Attribute Details

#ht_errorObject (readonly)

Returns the value of attribute ht_error.



6
7
8
# File 'lib/berkeley_library/location/location_result.rb', line 6

def ht_error
  @ht_error
end

#ht_record_urlObject (readonly)

Returns the value of attribute ht_record_url.



6
7
8
# File 'lib/berkeley_library/location/location_result.rb', line 6

def ht_record_url
  @ht_record_url
end

#oclc_numberObject (readonly)

Returns the value of attribute oclc_number.



6
7
8
# File 'lib/berkeley_library/location/location_result.rb', line 6

def oclc_number
  @oclc_number
end

#wc_errorObject (readonly)

Returns the value of attribute wc_error.



6
7
8
# File 'lib/berkeley_library/location/location_result.rb', line 6

def wc_error
  @wc_error
end

#wc_symbolsObject (readonly)

Returns the value of attribute wc_symbols.



6
7
8
# File 'lib/berkeley_library/location/location_result.rb', line 6

def wc_symbols
  @wc_symbols
end

Instance Method Details

#nrlf?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/berkeley_library/location/location_result.rb', line 16

def nrlf?
  @has_nrlf ||= wc_symbols.intersection(WorldCat::Symbols::NRLF).any?
end

#srlf?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/berkeley_library/location/location_result.rb', line 20

def srlf?
  @has_srlf ||= wc_symbols.intersection(WorldCat::Symbols::SRLF).any?
end

#uc_symbolsObject



24
25
26
# File 'lib/berkeley_library/location/location_result.rb', line 24

def uc_symbols
  @uc_symbols ||= wc_symbols.intersection(WorldCat::Symbols::UC)
end