Class: Cucumber::Messages::Location
- Defined in:
- lib/cucumber/messages/location.rb
Overview
Represents the Location message in Cucumber’s message protocol.
Points to a line and a column in a text file
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new Location from the given hash.
Instance Method Summary collapse
-
#initialize(line: 0, column: nil) ⇒ Location
constructor
A new instance of Location.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(line: 0, column: nil) ⇒ Location
Returns a new instance of Location.
17 18 19 20 21 22 23 24 |
# File 'lib/cucumber/messages/location.rb', line 17 def initialize( line: 0, column: nil ) @line = line @column = column super() end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
15 16 17 |
# File 'lib/cucumber/messages/location.rb', line 15 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
13 14 15 |
# File 'lib/cucumber/messages/location.rb', line 13 def line @line end |
Class Method Details
.from_h(hash) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/cucumber/messages/location.rb', line 33 def self.from_h(hash) return nil if hash.nil? new( line: hash[:line], column: hash[:column] ) end |