Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 879fcbe341
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (13 sloc) 0.287 kB
local Object = require('./object')
-- Create a class using Object
local Rect = Object:extend()
function Rect:initialize(w, h)
self.w = w
self.h = h
end
function Rect:getArea()
return self.w * self.h
end
-- Create an instance it.
local rect = Rect:new(4, 5)
print(rect:getArea())
Jump to Line
Something went wrong with that request. Please try again.