Class: Portage::Ucp::Rating

Inherits:
Data
  • Object
show all
Defined in:
lib/portage/ucp/value_objects.rb

Overview

schemas/shopping/types/rating.json

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, scale_max:, scale_min: 1, count: nil) ⇒ Rating

Returns a new instance of Rating.



72
# File 'lib/portage/ucp/value_objects.rb', line 72

def initialize(value:, scale_max:, scale_min: 1, count: nil) = super

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



71
72
73
# File 'lib/portage/ucp/value_objects.rb', line 71

def count
  @count
end

#scale_maxObject (readonly)

Returns the value of attribute scale_max

Returns:

  • (Object)

    the current value of scale_max



71
72
73
# File 'lib/portage/ucp/value_objects.rb', line 71

def scale_max
  @scale_max
end

#scale_minObject (readonly)

Returns the value of attribute scale_min

Returns:

  • (Object)

    the current value of scale_min



71
72
73
# File 'lib/portage/ucp/value_objects.rb', line 71

def scale_min
  @scale_min
end

#valueObject (readonly)

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



71
72
73
# File 'lib/portage/ucp/value_objects.rb', line 71

def value
  @value
end

Instance Method Details

#to_wire_hObject



74
75
76
# File 'lib/portage/ucp/value_objects.rb', line 74

def to_wire_h
  { "value" => value, "scale_min" => scale_min, "scale_max" => scale_max, "count" => count }.compact
end