title: Hiding a Lua metatable and only exposing an object's attributes
body: <p>How do you create a Lua object that only exposes its attributes and not its methods? For example:</p>
  
  
  
  <pre class="lang-lua prettyprint-override"><code>local obj = {
    attr1 = 1,
    attr2 = 2,
    print = function(...)
      print("obj print: ", ...)
    end,
  }
  </code></pre>
  
  <p>Produces:</p>
  
  <pre class="lang-lua prettyprint-override"><code>&gt; for k,v in pairs(obj) do print(k, v) end
  attr1   1
  attr2   2
  print   function: 0x7ffe1240a310
  </code></pre>
  
  <p>Also, is it possible to not use the colon syntax for OOP in Lua? I don't need inheritance, polymorphism, only encapsulation and privacy.</p>