Sha256: 156e7d42255b29178f6b709933a982924e4620cf0d686c2f2d22671c0780bf55
Contents?: true
Size: 590 Bytes
Versions: 8
Compression:
Stored size: 590 Bytes
Contents
# frozen_string_literal: true require 'readymade/response' module Readymade class Action class NonKeywordArgumentsError < StandardError; end def self.call(*args, &block) new(*args, &block).call end attr_reader :args, :data def initialize(args = {}) raise NonKeywordArgumentsError if args.present? && !args.is_a?(Hash) @args = @data = args @args.each do |name, value| instance_variable_set("@#{name}", value) end end def call; end def response(status, *args) Response.new(status, *args) end end end
Version data entries
8 entries across 8 versions & 1 rubygems