Module: Kilza::Class

Included in:
Java::Class, Objc::Class
Defined in:
lib/kilza/class.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#importsObject

Returns the value of attribute imports.



5
6
7
# File 'lib/kilza/class.rb', line 5

def imports
  @imports
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/kilza/class.rb', line 3

def name
  @name
end

#paramsObject

Returns the value of attribute params.



4
5
6
# File 'lib/kilza/class.rb', line 4

def params
  @params
end

#propertiesObject

Returns the value of attribute properties.



6
7
8
# File 'lib/kilza/class.rb', line 6

def properties
  @properties
end

Instance Method Details

#find(name) ⇒ Object



15
16
17
18
19
20
# File 'lib/kilza/class.rb', line 15

def find(name)
  @properties.each { |p|
    return p if (p.name == name)
  }
  nil
end

#initialize(name) ⇒ Object



8
9
10
11
12
13
# File 'lib/kilza/class.rb', line 8

def initialize(name)
  @name = Kilza::normalize(name).capitalize
  @properties = []
  @imports = []
  @params = []
end

#push(property) ⇒ Object



22
23
24
25
26
27
# File 'lib/kilza/class.rb', line 22

def push(property)
  p = find(property.name)
  if p.nil?
    @properties.push(property)
  end
end

#sourcesObject



29
30
# File 'lib/kilza/class.rb', line 29

def sources
end

#to_hashObject



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/kilza/class.rb', line 32

def to_hash
  properties = []
  @properties.each { |p|
    properties.push(p.to_hash)
  }
  hash = {
    :name => @name,
    :imports => @imports,
    :params => @params,
    :properties => properties
  }
  hash
end