Skip to content

Instantly share code, notes, and snippets.

@adambeynon
Created January 10, 2014 11:27
Show Gist options
  • Save adambeynon/8350406 to your computer and use it in GitHub Desktop.
Save adambeynon/8350406 to your computer and use it in GitHub Desktop.
module LocalStorage
def self.[](name)
`localStorage.getItem(name)`
end
def self.[]=(name, value)
`localStorage.setItem(name, value)`
end
def self.key?(name)
`localStorage.getItem(name) !== undefined`
end
end
LocalStorage[:user_id] = User.current.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment