Class: Cucumber::Messages::ParseError

Inherits:
Message show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Message::Utils

included

Methods included from Message::Serialization

#to_h, #to_json

Methods included from Message::Deserialization

included

Constructor Details

#initialize(source: SourceReference.new, message: '') ⇒ ParseError

Returns a new instance of ParseError.



1043
1044
1045
1046
1047
1048
1049
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1043

def initialize(
  source: SourceReference.new,
  message: ''
)
  @source = source
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



1041
1042
1043
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1041

def message
  @message
end

#sourceObject (readonly)

Returns the value of attribute source.



1039
1040
1041
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1039

def source
  @source
end

Class Method Details

.from_h(hash) ⇒ Object

Returns a new ParseError from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.

Cucumber::Messages::ParseError.from_h(some_hash) # => #<Cucumber::Messages::ParseError:0x... ...>


590
591
592
593
594
595
596
597
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 590

def self.from_h(hash)
  return nil if hash.nil?

  self.new(
    source: SourceReference.from_h(hash[:source]),
    message: hash[:message],
  )
end