Created
October 29, 2013 09:50
-
-
Save adambeynon/7211710 to your computer and use it in GitHub Desktop.
Opal native with block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Class.new | |
Foo = Class.new(Bar) do | |
def woosh | |
:kapow | |
end | |
end | |
# Native.new | |
LocalStorage = Native.new(`localStorage`) do | |
def [](key) | |
`getItem(key)` | |
end | |
def []=(key, value) | |
`setItem(key, value)` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment