Class: Vangrail::ScoreProviders::Transport
- Inherits:
-
Object
- Object
- Vangrail::ScoreProviders::Transport
- Defined in:
- lib/vangrail/score_provider.rb
Overview
Shared request and response bounds for every optional transport.
Instance Attribute Summary collapse
-
#feature_schema ⇒ Object
readonly
Returns the value of attribute feature_schema.
-
#max_input_bytes ⇒ Object
readonly
Returns the value of attribute max_input_bytes.
-
#max_output_bytes ⇒ Object
readonly
Returns the value of attribute max_output_bytes.
-
#model_id ⇒ Object
readonly
Returns the value of attribute model_id.
-
#reader_id ⇒ Object
readonly
Returns the value of attribute reader_id.
Instance Method Summary collapse
-
#initialize(reader_id:, model_id:, feature_schema:, max_input_bytes: DEFAULT_MAX_INPUT_BYTES, max_output_bytes: DEFAULT_MAX_OUTPUT_BYTES) ⇒ Transport
constructor
A new instance of Transport.
Constructor Details
#initialize(reader_id:, model_id:, feature_schema:, max_input_bytes: DEFAULT_MAX_INPUT_BYTES, max_output_bytes: DEFAULT_MAX_OUTPUT_BYTES) ⇒ Transport
Returns a new instance of Transport.
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/vangrail/score_provider.rb', line 57 def initialize(reader_id:, model_id:, feature_schema:, max_input_bytes: DEFAULT_MAX_INPUT_BYTES, max_output_bytes: DEFAULT_MAX_OUTPUT_BYTES) @reader_id = reader_id.to_s.freeze @model_id = model_id.to_s.freeze @feature_schema = Array(feature_schema).map(&:to_s).freeze @max_input_bytes = positive_integer(max_input_bytes, 'max_input_bytes') @max_output_bytes = positive_integer(max_output_bytes, 'max_output_bytes') raise ArgumentError, 'feature_schema is required' if @feature_schema.empty? end |
Instance Attribute Details
#feature_schema ⇒ Object (readonly)
Returns the value of attribute feature_schema.
54 55 56 |
# File 'lib/vangrail/score_provider.rb', line 54 def feature_schema @feature_schema end |
#max_input_bytes ⇒ Object (readonly)
Returns the value of attribute max_input_bytes.
54 55 56 |
# File 'lib/vangrail/score_provider.rb', line 54 def max_input_bytes @max_input_bytes end |
#max_output_bytes ⇒ Object (readonly)
Returns the value of attribute max_output_bytes.
54 55 56 |
# File 'lib/vangrail/score_provider.rb', line 54 def max_output_bytes @max_output_bytes end |
#model_id ⇒ Object (readonly)
Returns the value of attribute model_id.
54 55 56 |
# File 'lib/vangrail/score_provider.rb', line 54 def model_id @model_id end |
#reader_id ⇒ Object (readonly)
Returns the value of attribute reader_id.
54 55 56 |
# File 'lib/vangrail/score_provider.rb', line 54 def reader_id @reader_id end |