Class: BibTeX::Value
- Defined in:
- lib/relaton_bib/renderer/bibtex_builder.rb
Instance Method Summary collapse
-
#to_s(options = {}) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity.
Instance Method Details
#to_s(options = {}) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/relaton_bib/renderer/bibtex_builder.rb', line 4 def to_s( = {}) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity if .key?(:filter) opts = .reject { |k,| k == :filter || (k == :quotes && (!atomic? || symbol?)) } return convert([:filter]).to_s(opts) end return value.to_s unless .key?(:quotes) && atomic? q = Array([:quotes]) [q[0], value, q[-1]].compact.join end |