Skip to content

Instantly share code, notes, and snippets.

@kdabir
Created November 26, 2015 07:15
Show Gist options
  • Save kdabir/a27a609b26c076d75fcb to your computer and use it in GitHub Desktop.
Save kdabir/a27a609b26c076d75fcb to your computer and use it in GitHub Desktop.
using call on groovy object.
def now = new A()
class A{
def getCurrentDate() {new Date().format("yyyy-MM-dd HH:mm:ss")}
def call(){ getCurrentDate() }
}
now()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment