Class: Lev::Paramifier

Inherits:
Object show all
Includes:
ActiveAttr::Model, ActiveAttr::Typecasting
Defined in:
lib/lev/handler.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.booleanObject

Hack to provide ActiveAttr’s Boolean type concisely



9
# File 'lib/lev/handler.rb', line 9

def self.boolean; ActiveAttr::Typecasting::Boolean; end

Instance Method Details

#as_hash(*keys) ⇒ Object



11
12
13
14
# File 'lib/lev/handler.rb', line 11

def as_hash(*keys)
  keys = [keys].flatten.compact
  Hash[keys.collect { |key| [key, self.send(key)] }]
end