class Utusemi::Definition
Constants
- OPTION_METHODS
- UNPROXIED_METHODS
Attributes
attributes[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/utusemi/definition.rb, line 16 def initialize(options = {}) @attributes = {} @options = options end
Public Instance Methods
exec(*args, &block)
click to toggle source
# File lib/utusemi/definition.rb, line 21 def exec(*args, &block) instance_exec(*args, &block) if block_given? self end
method_missing(name, *args)
click to toggle source
# File lib/utusemi/definition.rb, line 26 def method_missing(name, *args) add_attribute(name, *args) end
Private Instance Methods
add_attribute(name, value = nil)
click to toggle source
# File lib/utusemi/definition.rb, line 32 def add_attribute(name, value = nil) fail AttributeDefinitionError, 'Block given' if block_given? @attributes[name.to_sym] = value.to_sym end