Class: Portage::Ucp::Media
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::Media
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/types/media.json
Instance Attribute Summary collapse
-
#alt_text ⇒ Object
readonly
Returns the value of attribute alt_text.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(type:, url:, alt_text: nil, width: nil, height: nil) ⇒ Media
constructor
A new instance of Media.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(type:, url:, alt_text: nil, width: nil, height: nil) ⇒ Media
Returns a new instance of Media.
42 |
# File 'lib/portage/ucp/value_objects.rb', line 42 def initialize(type:, url:, alt_text: nil, width: nil, height: nil) = super |
Instance Attribute Details
#alt_text ⇒ Object (readonly)
Returns the value of attribute alt_text
41 42 43 |
# File 'lib/portage/ucp/value_objects.rb', line 41 def alt_text @alt_text end |
#height ⇒ Object (readonly)
Returns the value of attribute height
41 42 43 |
# File 'lib/portage/ucp/value_objects.rb', line 41 def height @height end |
#type ⇒ Object (readonly)
Returns the value of attribute type
41 42 43 |
# File 'lib/portage/ucp/value_objects.rb', line 41 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url
41 42 43 |
# File 'lib/portage/ucp/value_objects.rb', line 41 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width
41 42 43 |
# File 'lib/portage/ucp/value_objects.rb', line 41 def width @width end |
Instance Method Details
#to_wire_h ⇒ Object
44 45 46 |
# File 'lib/portage/ucp/value_objects.rb', line 44 def to_wire_h { "type" => type, "url" => url, "alt_text" => alt_text, "width" => width, "height" => height }.compact end |