mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 13:12:34 +00:00
20 lines
464 B
Ruby
20 lines
464 B
Ruby
module CyberarmEngine
|
|
class Style
|
|
def initialize(hash = {})
|
|
@hash = hash
|
|
end
|
|
|
|
def method_missing(method, *args, &block)
|
|
if method.to_s.end_with?("=")
|
|
raise "Did not expect more than 1 argument" if args.size > 1
|
|
return @hash[method.to_s.sub("=", "").to_sym] = args.first
|
|
|
|
elsif args.size == 0
|
|
return @hash[method]
|
|
|
|
else
|
|
raise ArgumentError, "Did not expect arguments"
|
|
end
|
|
end
|
|
end
|
|
end |