module C2y
  class DSL::Context::Update
    attr_reader :result

    def initialize(&block)
      @result = OpenStruct.new({
        group: "alpha",
        reboot_strategy: "off",
      })

      instance_eval(&block)
    end

    private

    def group(channel)
      @result.group = channel.to_s
    end

    def reboot_strategy(strategy)
      @result.reboot_strategy = strategy.to_s
    end
  end
end

module C2y
  class DSL::Context::Update
    attr_reader :result

    def initialize(&block)
      @result = OpenStruct.new({
        group: "alpha",
        reboot_strategy: "off",
      })

      instance_eval(&block)
    end

    [:group, :reboot_strategy].each do |attr|
      define_method(attr) do |arg|
        @result.send("#{attr}=", arg)
      end

      private attr
    end
  end
end

Use dynamic method definition in Update
Use dynamic method definition in Update
