Class: Cucumber::Messages::PickleStepArgument
- Defined in:
- lib/cucumber/messages/pickle_step_argument.rb
Overview
Represents the PickleStepArgument message in Cucumber’s message protocol.
An optional argument
Instance Attribute Summary collapse
-
#data_table ⇒ Object
readonly
Returns the value of attribute data_table.
-
#doc_string ⇒ Object
readonly
Returns the value of attribute doc_string.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new PickleStepArgument from the given hash.
Instance Method Summary collapse
-
#initialize(doc_string: nil, data_table: nil) ⇒ PickleStepArgument
constructor
A new instance of PickleStepArgument.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(doc_string: nil, data_table: nil) ⇒ PickleStepArgument
Returns a new instance of PickleStepArgument.
17 18 19 20 21 22 23 24 |
# File 'lib/cucumber/messages/pickle_step_argument.rb', line 17 def initialize( doc_string: nil, data_table: nil ) @doc_string = doc_string @data_table = data_table super() end |
Instance Attribute Details
#data_table ⇒ Object (readonly)
Returns the value of attribute data_table.
15 16 17 |
# File 'lib/cucumber/messages/pickle_step_argument.rb', line 15 def data_table @data_table end |
#doc_string ⇒ Object (readonly)
Returns the value of attribute doc_string.
13 14 15 |
# File 'lib/cucumber/messages/pickle_step_argument.rb', line 13 def doc_string @doc_string end |
Class Method Details
.from_h(hash) ⇒ Object
Returns a new PickleStepArgument from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::PickleStepArgument.from_h(some_hash) # => #<Cucumber::Messages::PickleStepArgument:0x... ...>
33 34 35 36 37 38 39 40 |
# File 'lib/cucumber/messages/pickle_step_argument.rb', line 33 def self.from_h(hash) return nil if hash.nil? new( doc_string: PickleDocString.from_h(hash[:docString]), data_table: PickleTable.from_h(hash[:dataTable]) ) end |