LUBE help! Class Commons [subclass?]
Posted: Tue Dec 24, 2013 2:46 am
So I'm having a problem using LUBE. I read the article about how to use LUBE, and I understood that it uses a Class Commons library, and I picked the middleclass.lua library and along with middleclass-commons.lua
However it seems I am having a problem with syntax possibly?
-Code from the LUBE documentation guide-
The LUBE guide shows how to make an instance/object of the Client class. It doesn't explain much on what it's doing. I don't understand what the implemented variable is? Also not sure how protocolClient went from being a variable to a function seeing the last line showing protocolClient()
An explanation of the code might be helpful !
However when writing this using the Class Commons syntax since the LUBE guide stated it was just using a generic syntax. I don't understand why they're making a subclass inside the lube.Client class? I thought they're suppose to be making an object from it... Anyways my code that I made using the Class Commons guide after installing middleclass was this.
-line of code that gave me error-
LOVE responded me with
Anyways I hope I gave you guys enough information to help me figure out what the problem is. Thank you !
However it seems I am having a problem with syntax possibly?
-Code from the LUBE documentation guide-
Code: Select all
protocolClient = subclass(lube.Client)
protocolClient._implemented = true
-- define protocolClient
client = protocolClient()
An explanation of the code might be helpful !
However when writing this using the Class Commons syntax since the LUBE guide stated it was just using a generic syntax. I don't understand why they're making a subclass inside the lube.Client class? I thought they're suppose to be making an object from it... Anyways my code that I made using the Class Commons guide after installing middleclass was this.
-line of code that gave me error-
Code: Select all
protocolClient = common.instance(lube.Client,'protocolClient')
-all of the code-Can't use a generic client object directly, please provide an implementation
Code: Select all
protocolClient = common.instance(lube.Client,'protocolClient')
protocolClient._implemented = true
-- define protocolClient
client = protocolClient()