# frozen_string_literal: true

# The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
module Cucumber
  module Messages
    ##
    # Represents the PickleTableCell message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
    ##
    ##
    class PickleTableCell < Message
      attr_reader :value

      def initialize(
        value: ''
      )
        @value = value
        super()
      end

      ##
      # Returns a new PickleTableCell from the given hash.
      # If the hash keys are camelCased, they are properly assigned to the
      # corresponding snake_cased attributes.
      #
      #   Cucumber::Messages::PickleTableCell.from_h(some_hash) # => #<Cucumber::Messages::PickleTableCell:0x... ...>
      ##
      def self.from_h(hash)
        return nil if hash.nil?

        new(
          value: hash[:value]
        )
      end
    end
  end
end
