Class: Headmin::Filter::OperatorView

Inherits:
ViewModel
  • Object
show all
Defined in:
app/models/headmin/filter/operator_view.rb

Instance Method Summary collapse

Methods inherited from ViewModel

#attributes, #initialize, #to_hash

Constructor Details

This class inherits a constructor from ViewModel

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ViewModel

Instance Method Details

#allowed_operatorsObject



4
5
6
# File 'app/models/headmin/filter/operator_view.rb', line 4

def allowed_operators
  @allowed_operators || []
end

#operator_symbolObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/models/headmin/filter/operator_view.rb', line 12

def operator_symbol
  {
    eq: "= #{I18n.t("headmin.filters.operators.eq")}",
    not_eq: "≠ #{I18n.t("headmin.filters.operators.not_eq")}",
    gt: "> #{I18n.t("headmin.filters.operators.gt")}",
    gteq: "≥ #{I18n.t("headmin.filters.operators.gteq")}",
    lt: "< #{I18n.t("headmin.filters.operators.lt")}",
    lteq: "≤ #{I18n.t("headmin.filters.operators.lteq")}",
    starts_with: "⊏ #{I18n.t("headmin.filters.operators.starts_with")}",
    ends_with: "⊐ #{I18n.t("headmin.filters.operators.ends_with")}",
    matches: "≈ #{I18n.t("headmin.filters.operators.matches")}",
    does_not_match: "≉ #{I18n.t("headmin.filters.operators.does_not_match")}",
    is_null: "○ #{I18n.t("headmin.filters.operators.is_null")}",
    is_not_null: "● #{I18n.t("headmin.filters.operators.is_not_null")}",
    in: "∋ #{I18n.t("headmin.filters.operators.in")}",
    not_in: "∌ #{I18n.t("headmin.filters.operators.not_in")}",
    between: "↔ #{I18n.t("headmin.filters.operators.between")}",
    not_between: "⥈ #{I18n.t("headmin.filters.operators.not_between")}"
  }
end

#selectedObject



8
9
10
# File 'app/models/headmin/filter/operator_view.rb', line 8

def selected
  @selected || nil
end