Created
April 2, 2019 16:30
-
-
Save perryqh/f2cb371d67434905dbefcc349708c597 to your computer and use it in GitHub Desktop.
pseudo code for client urn settings
This file contains hidden or 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 StringIsWidgetSetting < String | |
attr_reader :widget | |
def initialize(field, widget) | |
super(widget.send(field)) | |
@widget = widget | |
end | |
def method_missing(method_name, *args, &block) | |
widget.method_missing(method_name, args, block) | |
end | |
end | |
# in Widget | |
def client_urn | |
@client_urn ||= StringIsWidgetSetting.new(:client_urn, self) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment