Class: Gliner::FormatOptions

Inherits:
Data
  • Object
show all
Defined in:
lib/gliner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#include_confidenceObject (readonly)

Returns the value of attribute include_confidence

Returns:

  • (Object)

    the current value of include_confidence



40
41
42
# File 'lib/gliner.rb', line 40

def include_confidence
  @include_confidence
end

#include_spansObject (readonly)

Returns the value of attribute include_spans

Returns:

  • (Object)

    the current value of include_spans



40
41
42
# File 'lib/gliner.rb', line 40

def include_spans
  @include_spans
end

Class Method Details

.from(input) ⇒ Object



41
42
43
44
45
46
47
48
# File 'lib/gliner.rb', line 41

def self.from(input)
  return input if input.is_a?(FormatOptions)

  new(
    include_confidence: input.fetch(:include_confidence, false),
    include_spans: input.fetch(:include_spans, false)
  )
end