Module: Card::Set::Type::Image::Format
- Extended by:
- AbstractFormat
- Includes:
- File::Format
- Defined in:
- platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb
Instance Method Summary
collapse
#handle_source, #view: core
Instance Method Details
#closed_size ⇒ Object
56
57
58
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 56
def closed_size
:icon
end
|
#default_size ⇒ Object
64
65
66
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 64
def default_size
:medium
end
|
#determine_image_size ⇒ Object
68
69
70
71
72
73
74
75
76
77
78
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 68
def determine_image_size
voo.size =
case
when nest_mode == :closed then closed_size
when voo.size.present? then voo.size.to_sym
when main? then main_size
else default_size
end
voo.size = :original if voo.size == :full
voo.size
end
|
#main_size ⇒ Object
60
61
62
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 60
def main_size
:large
end
|
#selected_version ⇒ Object
45
46
47
48
49
50
51
52
53
54
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 45
def selected_version
size = determine_image_size
image = card.image
if size && size != :original && !svg?
image.versions[size]
else
image
end
end
|
#short_content ⇒ Object
28
29
30
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 28
def short_content
render_core size: :icon
end
|
36
37
38
39
40
41
42
43
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 36
def source
return card.content if card.web?
image = selected_version
return "" unless image.valid?
contextualize_path image.url
end
|
#view: inline ⇒ Object
80
81
82
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 80
view :inline do
_render_core
end
|
#view: one_line_content ⇒ Object
24
25
26
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 24
view :one_line_content do
_render_core size: :icon
end
|
#view: source ⇒ Object
32
33
34
|
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb', line 32
view :source, unknown: :blank do
source
end
|