Class: Cucumber::Messages::PickleDocString

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(media_type: nil, content: '') ⇒ PickleDocString

Returns a new instance of PickleDocString.



1146
1147
1148
1149
1150
1151
1152
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1146

def initialize(
  media_type: nil,
  content: ''
)
  @media_type = media_type
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



1144
1145
1146
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1144

def content
  @content
end

#media_typeObject (readonly)

Returns the value of attribute media_type.



1142
1143
1144
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1142

def media_type
  @media_type
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


635
636
637
638
639
640
641
642
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 635

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

  self.new(
    media_type: hash[:mediaType],
    content: hash[:content],
  )
end