Module: Card::Set::Type::Image::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod020-card-mod-bar_and_box/type/image.rb,
card/tmpsets/set/mod021-card-mod-bar_and_box/type/image.rb

Instance Method Summary collapse

Instance Method Details

#image_boxObject



21
22
23
24
25
26
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/type/image.rb', line 21

def image_box
  voo.size ||= :medium
  wrap_with :div, title: image_box_title, class: "image-box #{voo.size}" do
    yield image_box_size
  end
end

#image_box_card_nameObject



34
35
36
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/type/image.rb', line 34

def image_box_card_name
  card.name.junction? ? card.name.left : card.name
end


38
39
40
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/type/image.rb', line 38

def image_box_link_target
  image_box_card_name
end

#image_box_sizeObject

METHODS FOR OVERRIDE



30
31
32
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/type/image.rb', line 30

def image_box_size
  IMAGE_BOX_SIZE_MAP[voo.size.to_sym] || :medium
end

#image_box_titleObject



42
43
44
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/type/image.rb', line 42

def image_box_title
  voo.title || image_box_card_name
end

#view: boxedObject



13
14
15
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/type/image.rb', line 13

view :boxed, unknown: true do
  image_box { |size| render_core size: size }
end


17
18
19
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/type/image.rb', line 17

view :boxed_link, unknown: true do
  image_box { |size| link_to_card image_box_link_target, render_core(size: size) }
end