Class: Cucumber::Messages::SourceReference

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

Overview

Represents the SourceReference message in Cucumber’s message protocol.

*

Points to a [Source](#io.cucumber.messages.Source) identified by `uri` and a
[Location](#io.cucumber.messages.Location) within that file.

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(uri: nil, java_method: nil, java_stack_trace_element: nil, location: nil) ⇒ SourceReference

Returns a new instance of SourceReference.



1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1355

def initialize(
  uri: nil,
  java_method: nil,
  java_stack_trace_element: nil,
  location: nil
)
  @uri = uri
  @java_method = java_method
  @java_stack_trace_element = java_stack_trace_element
  @location = location
end

Instance Attribute Details

#java_methodObject (readonly)

Returns the value of attribute java_method.



1349
1350
1351
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1349

def java_method
  @java_method
end

#java_stack_trace_elementObject (readonly)

Returns the value of attribute java_stack_trace_element.



1351
1352
1353
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1351

def java_stack_trace_element
  @java_stack_trace_element
end

#locationObject (readonly)

Returns the value of attribute location.



1353
1354
1355
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1353

def location
  @location
end

#uriObject (readonly)

Returns the value of attribute uri.



1347
1348
1349
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1347

def uri
  @uri
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


795
796
797
798
799
800
801
802
803
804
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 795

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

  self.new(
    uri: hash[:uri],
    java_method: JavaMethod.from_h(hash[:javaMethod]),
    java_stack_trace_element: JavaStackTraceElement.from_h(hash[:javaStackTraceElement]),
    location: Location.from_h(hash[:location]),
  )
end