Class: Cucumber::Messages::Background
- 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
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
-
#location ⇒ Object
readonly
The location of the ‘Background` keyword.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new Background from the given hash.
Instance Method Summary collapse
-
#initialize(location: Location.new, keyword: '', name: '', description: '', steps: [], id: '') ⇒ Background
constructor
A new instance of Background.
Methods included from Message::Utils
Methods included from Message::Serialization
Methods included from Message::Deserialization
Constructor Details
#initialize(location: Location.new, keyword: '', name: '', description: '', steps: [], id: '') ⇒ Background
Returns a new instance of Background.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 289 def initialize( location: Location.new, keyword: '', name: '', description: '', steps: [], id: '' ) @location = location @keyword = keyword @name = name @description = description @steps = steps @id = id end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
283 284 285 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 283 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
287 288 289 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 287 def id @id end |
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
279 280 281 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 279 def keyword @keyword end |
#location ⇒ Object (readonly)
The location of the ‘Background` keyword
277 278 279 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 277 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
281 282 283 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 281 def name @name end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
285 286 287 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 285 def steps @steps end |
Class Method Details
.from_h(hash) ⇒ Object
Returns a new Background from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::Background.from_h(some_hash) # => #<Cucumber::Messages::Background:0x... ...>
122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 122 def self.from_h(hash) return nil if hash.nil? self.new( location: Location.from_h(hash[:location]), keyword: hash[:keyword], name: hash[:name], description: hash[:description], steps: hash[:steps]&.map { |item| Step.from_h(item) }, id: hash[:id], ) end |