Module: Ccp::Serializers
- Defined in:
- lib/ccp/serializers.rb
Defined Under Namespace
Modules: Core, Json, Yaml
Constant Summary
collapse
- NotFound =
Class.new(RuntimeError)
Class Method Summary
collapse
Class Method Details
.lookup(name) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/ccp/serializers.rb', line 8
def self.lookup(name)
case name
when :json, 'json'; Ccp::Serializers::Json
when :yaml, 'yaml'; Ccp::Serializers::Yaml
else
Ccp::Serializers::Core.instance_methods.each do |key|
name.must.duck(key) { raise NotFound, "%s: %s" % [name.class, name] }
end
return name
end
end
|