sprsquish (owner)

Revisions

gist: 99134 Download_button fork
public
Public Clone URL: git://gist.github.com/99134.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
      def type
        case attributes['type']
          when 'cancel' then :cancel
          when 'form' then :form
          when 'result' then :result
          when 'submit' then :submit
          else nil
        end
      end
 
      ##
      # Set the type (see type)
      def type=(t)
        case t
          when :cancel then attributes['type'] = 'cancel'
          when :form then attributes['type'] = 'form'
          when :result then attributes['type'] = 'result'
          when :submit then attributes['type'] = 'submit'
          else attributes['type'] = nil
        end
      end