{"record":{"id":"9d9f39aa8392ff97","repo":"flippercloud/flipper","slug":"object-inspect-cannot-be-converted-into-an-expr","errorCode":null,"errorMessage":"#{object.inspect} cannot be converted into an expression","messagePattern":"#(.+?) cannot be converted into an expression","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/flipper/expression.rb","lineNumber":19,"sourceCode":"require \"flipper/expression/builder\"\nrequire \"flipper/expression/constant\"\n\nmodule Flipper\n  class Expression\n    include Builder\n\n    PruneResult = Struct.new(:expression, :constant_value, keyword_init: true)\n    private_constant :PruneResult\n\n    def self.build(object)\n      return object if object.is_a?(self) || object.is_a?(Constant)\n\n      case object\n      when Hash\n        name = object.keys.first\n        args = object.values.first\n        unless name\n          raise ArgumentError, \"#{object.inspect} cannot be converted into an expression\"\n        end\n\n        new(name, Array(args).map { |o| build(o) })\n      when String, Numeric, FalseClass, TrueClass\n        Expression::Constant.new(object)\n      when Symbol\n        Expression::Constant.new(object.to_s)\n      else\n        raise ArgumentError, \"#{object.inspect} cannot be converted into an expression\"\n      end\n    end\n\n    # Use #build\n    private_class_method :new\n\n    attr_reader :name, :function, :args\n\n    def initialize(name, args = [])","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/flippercloud/flipper/blob/1f86de3ec91521585b156445e156642938b19cb0/lib/flipper/expression.rb#L1-L37","documentation":"Error \"#{object.inspect} cannot be converted into an expression\" thrown in flippercloud/flipper.","triggerScenarios":"Thrown at lib/flipper/expression.rb:19 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Build the expression with Flipper::Expression builders (e.g. Flipper.expression(...)) or a supported Hash form","Use the documented expression DSL instead of passing arbitrary objects","Check the value type: only Hashes with valid operator keys and Expression objects are convertible"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1f86de3ec91521585b156445e156642938b19cb0","analyzedAt":"2026-08-23T04:36:09.896Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}