Sha256: e9591762fe8409f098154084f41dc33a6e2caa5092ccb7784971c6d25544e599

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Type
# Set: All "NotificationTemplate" cards
#
module NotificationTemplate;
extend Card::Set
def self.source_location; "/Users/ezl5238/dev/decko/gem/mod/follow/set/type/notification_template.rb"; end
card_reader :contextual_class
card_reader :disappear
card_reader :message

def deliver context
  success.flash alert_message(context)
end

def alert_message context
  mcard = message.present? ? message_card : self
  format(:html).alert_message context, mcard
end

module HtmlFormat; module_parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  def alert_message context, message_card
    mformat = subformat message_card
    alert card.alert_class, true, card.disappear? do
      mformat.contextual_content context, view: alert_view(mformat)
    end
  end

  def alert_view format
    format.respond_to?(:notify) ? format.notify : :core
  end
end

def disappear?
  disappear.present? ? disappear_card.checked? : true
end

def alert_class
  contextual_class.present? ? contextual_class_card.item_name : :success
end
end;end;end;end;
# ~~ generated from /Users/ezl5238/dev/decko/gem/mod/follow/set/type/notification_template.rb ~~

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
card-1.102.0 tmpsets/set/mod026-follow/type/notification_template.rb