Module: Alexandrite::Helpers::Format

Included in:
GoogleAPI, OCLCAPI
Defined in:
lib/helpers/format.rb

Overview

Format inputs and options

Instance Method Summary collapse

Instance Method Details

#add_fields(*fields) ⇒ Object



13
14
15
# File 'lib/helpers/format.rb', line 13

def add_fields(*fields)
  "&fields=items(volumeInfo/#{fields.join(',volumeInfo/')})"
end

#remove_non_digits(string) ⇒ String

Parameters:

  • string (String)

Returns:

  • (String)


9
10
11
# File 'lib/helpers/format.rb', line 9

def remove_non_digits(string)
  string.gsub!(/[^+\d]/, '')
end