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.
18 19 20 21 22 23 24 25 |
# File 'lib/cucumber/messages/location.rb', line 18 def initialize( line: 0, column: nil ) @line = line @column = column super() end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
16 17 18 |
# File 'lib/cucumber/messages/location.rb', line 16 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
14 15 16 |
# File 'lib/cucumber/messages/location.rb', line 14 def line @line end |
Class Method Details
.from_h(hash) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/cucumber/messages/location.rb', line 34 def self.from_h(hash) return nil if hash.nil? new( line: hash[:line], column: hash[:column] ) end |