Revision 8347a623
Added by Marc Dequènes over 14 years ago
- ID 8347a6232895a0b54db575b002b3e2598cdf2764
lib/cyborghood/command_runner.rb | ||
---|---|---|
|
||
return if cmdline.empty?
|
||
content_ref = cmdline.shift
|
||
part = shared_parameters[content_ref]
|
||
unless part.type == "text/plain"
|
||
ref, part = Order.dereference_param(shared_parameters, content_ref)
|
||
unless part.content_type == "text/plain"
|
||
result.message = _("Attachment has wrong content-type.")
|
||
return result
|
||
end
|
lib/cyborghood/order.rb | ||
---|---|---|
end
|
||
|
||
class SharedParameter
|
||
attr_reader :type, :content
|
||
attr_reader :content_type, :content
|
||
|
||
def initialize(content, type = nil)
|
||
def initialize(content, content_type = nil)
|
||
@content = content
|
||
@type = type
|
||
@content_type = content_type
|
||
end
|
||
end
|
||
|
||
... | ... | |
|
||
def self.dereference_param(shared_parameters, param, ref = nil)
|
||
if param.is_a? SharedParameter
|
||
[ref, ParameterReference.new(ref)]
|
||
[ref, param]
|
||
elsif param.is_a? ParameterReference
|
||
d_ref = param.reference
|
||
d_param = shared_parameters[d_ref]
|
Also available in: Unified diff
[fix] Order management was broken #2