Class: Cucumber::Messages::DocString

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

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(location: Location.new, media_type: nil, content: '', delimiter: '') ⇒ DocString

Returns a new instance of DocString.



374
375
376
377
378
379
380
381
382
383
384
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 374

def initialize(
  location: Location.new,
  media_type: nil,
  content: '',
  delimiter: ''
)
  @location = location
  @media_type = media_type
  @content = content
  @delimiter = delimiter
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



370
371
372
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 370

def content
  @content
end

#delimiterObject (readonly)

Returns the value of attribute delimiter.



372
373
374
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 372

def delimiter
  @delimiter
end

#locationObject (readonly)

Returns the value of attribute location.



366
367
368
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 366

def location
  @location
end

#media_typeObject (readonly)

Returns the value of attribute media_type.



368
369
370
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 368

def media_type
  @media_type
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


186
187
188
189
190
191
192
193
194
195
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 186

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

  self.new(
    location: Location.from_h(hash[:location]),
    media_type: hash[:mediaType],
    content: hash[:content],
    delimiter: hash[:delimiter],
  )
end