Module: Card::Set::All::Error::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod004-format/all/error.rb
Instance Method Summary collapse
-
#error_messages ⇒ Object
-
#simple_error_message(message) ⇒ Object
for override.
-
#standard_error_message(error) ⇒ Object
for override.
-
#unsupported_view_error_message(view) ⇒ Object
-
#view: bad_address ⇒ Object
-
#view: compact_missing ⇒ Object
-
#view: denial ⇒ Object
-
#view: errors ⇒ Object
-
#view: not_found ⇒ Object
-
#view: server_error ⇒ Object
-
#view: unknown ⇒ Object
Instance Method Details
#error_messages ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 39 def card.errors.map do |error| if error.attribute == :abort error. else error end end end |
#simple_error_message(message) ⇒ Object
for override
50 51 52 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 50 def end |
#standard_error_message(error) ⇒ Object
for override
55 56 57 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 55 def error "#{error.attribute.to_s.upcase}: #{error.}" end |
#unsupported_view_error_message(view) ⇒ Object
59 60 61 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 59 def view t :format_unsupported_view, view: view, cardname: card.name end |
#view: bad_address ⇒ Object
30 31 32 33 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 30 view :bad_address, perms: :none do root.error_status = 404 t(:format_bad_address) end |
#view: compact_missing ⇒ Object
9 10 11 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 9 view :compact_missing, perms: :none, compact: true do "" end |
#view: denial ⇒ Object
21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 21 view :denial, perms: :none do focal? ? t(:format_denial) : "" end |
#view: errors ⇒ Object
35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 35 view :errors do ["Problem:", "", ].flatten.join "\n" end |
#view: not_found ⇒ Object
25 26 27 28 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 25 view :not_found, perms: :none do error_name = card.name.present? ? safe_name : t(:format_not_found_no_name) t(:format_not_found_named, cardname: error_name) end |
#view: server_error ⇒ Object
17 18 19 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 17 view :server_error, perms: :none do t(:format_server_error) end |
#view: unknown ⇒ Object
13 14 15 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/error.rb', line 13 view :unknown, perms: :none, cache: :never do "" end |