Class: Retab::AllItemsMatchCondition

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_tests/all_items_match_condition.rb

Constant Summary collapse

HASH_ATTRS =
{
  kind: :kind,
  condition: :condition
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ AllItemsMatchCondition

Returns a new instance of AllItemsMatchCondition.



17
18
19
20
21
# File 'lib/retab/workflow_tests/all_items_match_condition.rb', line 17

def initialize(json)
  hash = self.class.normalize(json)
  @kind = hash[:kind]
  @condition = hash[:condition] ? (case hash[:condition][:kind] when "all_items_match" then Retab::AllItemsMatchCondition.new(hash[:condition]) when "any_item_matches" then Retab::AnyItemMatchesCondition.new(hash[:condition]) when "array_contains" then Retab::ArrayContainsCondition.new(hash[:condition]) when "between" then Retab::BetweenCondition.new(hash[:condition]) when "ends_with" then Retab::EndsWithCondition.new(hash[:condition]) when "json_schema_valid" then Retab::JsonSchemaValidCondition.new(hash[:condition]) when "length_compare" then Retab::LengthCompareCondition.new(hash[:condition]) when "llm_judged_as" then Retab::LlmJudgedAsCondition.new(hash[:condition]) when "llm_not_judged_as" then Retab::LlmNotJudgedAsCondition.new(hash[:condition]) when "not_contains" then Retab::NotContainsCondition.new(hash[:condition]) when "not_equals" then Retab::NotEqualsCondition.new(hash[:condition]) when "not_exists" then Retab::NotExistsCondition.new(hash[:condition]) when "number_compare" then Retab::NumberCompareCondition.new(hash[:condition]) when "object_contains" then Retab::ObjectContainsCondition.new(hash[:condition]) when "similarity_gte" then Retab::SimilarityGteCondition.new(hash[:condition]) else hash[:condition] end) : nil
end

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



13
14
15
# File 'lib/retab/workflow_tests/all_items_match_condition.rb', line 13

def condition
  @condition
end

#kindObject

Returns the value of attribute kind.



13
14
15
# File 'lib/retab/workflow_tests/all_items_match_condition.rb', line 13

def kind
  @kind
end