Skip to content

Instantly share code, notes, and snippets.

@raphink
Last active December 19, 2015 22:39
Show Gist options
  • Save raphink/6029033 to your computer and use it in GitHub Desktop.
Save raphink/6029033 to your computer and use it in GitHub Desktop.
lens { 'Shells.lns' }
resource_path { |r| "$target/*[.='#{r[:name]}']" }
# exists? is automatic
# destroy is automatic
def create
augopen! { |aug| aug.set('$target/01', resource[:name]) }
end
lens { 'Shells.lns' }
resource_path { |r| "$target/*[.='#{r[:name]}']" }
# exists? is automatic
# destroy is automatic
define_augmethod!(:create) do |aug, resource|
aug.set('$target/01', resource[:name])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment