class Elibri::ONIX::Dict::CoverType

Constants

ALL
HARDBACK
PAPERBACK
PLASTIC

Attributes

id[R]

id to wartość jaka będzie zapisana w polu cover_type_id dla produktu. name to nazwa w obrębie Elibri

key[R]

id to wartość jaka będzie zapisana w polu cover_type_id dla produktu. name to nazwa w obrębie Elibri

product_form[R]

id to wartość jaka będzie zapisana w polu cover_type_id dla produktu. name to nazwa w obrębie Elibri

product_form_detail[R]

id to wartość jaka będzie zapisana w polu cover_type_id dla produktu. name to nazwa w obrębie Elibri

Public Class Methods

all() click to toggle source
# File lib/elibri_onix_dict/cover_type.rb, line 37
def self.all
  ALL
end
determine_cover_type(product_form, product_form_detail) click to toggle source
# File lib/elibri_onix_dict/cover_type.rb, line 32
def self.determine_cover_type(product_form, product_form_detail)
  matching_cover = all.find { |cover| cover.product_form == product_form && cover.product_form_detail == product_form_detail }
  I18n::t("products.cover_type.#{matching_cover.key}") if matching_cover
end
find(cover_type_id) click to toggle source
# File lib/elibri_onix_dict/cover_type.rb, line 28
def self.find(cover_type_id)
  self.all.find {|cover_type| cover_type.id == cover_type_id }
end

Public Instance Methods

name() click to toggle source
# File lib/elibri_onix_dict/cover_type.rb, line 24
def name
  I18n::t("products.cover_type.#{key}")
end