Class: C2eCore::Drops::OrderRatingDrop

Inherits:
BaseDrop
  • Object
show all
Defined in:
/build/app/mailers/c2e_core/drops/order_rating_drop.rb

Instance Method Summary collapse

Constructor Details

#initialize(rating_note) ⇒ OrderRatingDrop

Returns a new instance of OrderRatingDrop.



7
8
9
10
# File '/build/app/mailers/c2e_core/drops/order_rating_drop.rb', line 7

def initialize(rating_note)
  super()
  @rating_note = rating_note
end

Instance Method Details

#rating_typeString

Returns - Translated type of current rating.

Returns:

  • (String)
    • Translated type of current rating.



23
24
25
# File '/build/app/mailers/c2e_core/drops/order_rating_drop.rb', line 23

def rating_type
  @rating_note.note_type.to_s
end

#rating_type_codeString

Returns - Code of current rating. E.g.: “hodnocení - způsob doručení”.

Returns:

  • (String)
    • Code of current rating. E.g.: “hodnocení - způsob doručení”



28
29
30
# File '/build/app/mailers/c2e_core/drops/order_rating_drop.rb', line 28

def rating_type_code
  @rating_note.note_type.code
end

#textString

Returns - Text of current rating. May be blank.

Returns:

  • (String)
    • Text of current rating. May be blank



13
14
15
# File '/build/app/mailers/c2e_core/drops/order_rating_drop.rb', line 13

def text
  @rating_note.text
end

#valueInteger

Returns - Value of current rating. Possible values are from 0 to 5.

Returns:

  • (Integer)
    • Value of current rating. Possible values are from 0 to 5.



18
19
20
# File '/build/app/mailers/c2e_core/drops/order_rating_drop.rb', line 18

def value
  @rating_note.value.to_i / 10
end