Skip to content

Instantly share code, notes, and snippets.

@sagax
Last active February 24, 2016 19:47
Show Gist options
  • Save sagax/f00c1caed92e0095f6e9 to your computer and use it in GitHub Desktop.
Save sagax/f00c1caed92e0095f6e9 to your computer and use it in GitHub Desktop.
javascript, defineProperties
class Item
constructor: (@url, @description, @tags = [], @firstname = '', @secondname = '') ->
@uid = gen_id.gen_item_uid()
Object.defineProperties @prototype,
fullname:
get: ->
@firstname + ' ' + @secondname
set: (name) ->
name = name.split ' '
@firstname = name[0] || ''
@secondname = name[1] || ''
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment