File: class.rb

package info (click to toggle)
grantlee5 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,028 kB
  • sloc: cpp: 24,265; javascript: 6,043; python: 299; sh: 109; ruby: 24; makefile: 15
file content (28 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /usr/bin/env ruby

{% include licence|append:".rb" %}

require 'Qt4'

class {{ className }} {% if baseClass %} < {{ baseClass.type }}{% endif %}

{% for property in properties %}
  {% if property.readonly %}
    attr_reader :{{property.name}}
  {% else %}
    attr_accessor :{{property.name}}
  {% endif %}

{% endfor %}
    def initialize
        super
    end

{% with "true" as default %}
  {% for method in methods %}
    def {{ method.name }}{% if method.args %}({% include "args.rb" %}){% endif %}
    end

  {% endfor %}
{% endwith %}
end