Skip to content

Instantly share code, notes, and snippets.

@havenwood

havenwood/iis.rb Secret

Created January 15, 2020 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/aa1204fa18943ae8dbb204e47cab6785 to your computer and use it in GitHub Desktop.
Save havenwood/aa1204fa18943ae8dbb204e47cab6785 to your computer and use it in GitHub Desktop.
class IIS
class Website
def initialize(iis)
@shell = iis.shell
end
end
class Mailbox
end
module Chaining
ATTRIBUTES = {website: :Website,
mailbox: :Mailbox}.freeze
ATTRIBUTES.each do |name, const|
define_method name do
instance_variable_set "@#{name}", IIS.const_get(const).new(self)
end
end
end
include Chaining
attr_reader :shell
def initialize(shell:)
@shell = shell
end
end
IIS.new(shell: '🦪').website
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment