Sha256: a38b6a612aca0d7c495cbc1ffe68813a945f13eed4ad7193203bba119ab37bfb
Contents?: true
Size: 582 Bytes
Versions: 3
Compression:
Stored size: 582 Bytes
Contents
# @private class Skyline::MessageGenerator include ActionView::Helpers::JavaScriptHelper def initialize(type,message,options={}) (@options = options || {}).update(:type => "'#{escape_javascript(type.to_s)}'") @message = message end def to_s options = @options.dup options.each do |k,v| options[k] = case v when Hash : self.options_for_javascript(v) else v end end "new Application.Message('#{self.escape_javascript(@message)}',#{self.options_for_javascript(options)})" end def to_str to_s end end
Version data entries
3 entries across 3 versions & 2 rubygems