lib/tori/define.rb in tori-0.0.1 vs lib/tori/define.rb in tori-0.0.2
- old
+ new
@@ -1,8 +1,8 @@
module Tori
module Define
- def tori(name, id: :id)
+ def tori(name)
name_hash_get = "#{name}_hash".to_sym
name_ivar = "@#{name}".to_sym
name_hash_ivar = "@#{name}_hash".to_sym
define_method(name) do
@@ -12,10 +12,10 @@
define_method("#{name}=") do |uploader|
instance_variable_set name_ivar, uploader
end
define_method(name_hash_get) do
- Tori.config.hash_method.call "#{self.class.name}/#{__send__(id.to_sym)}"
+ Tori.config.filename_callback.call(self)
end
end
end
end