Module: Yaoc::MappingBase
- Defined in:
- lib/yaoc/mapping_base.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(other) ⇒ Object
4 5 6 |
# File 'lib/yaoc/mapping_base.rb', line 4 def self.included(other) other.extend(ClassMethods) end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/yaoc/mapping_base.rb', line 20 def call unless to_convert.nil? self.class.mapping_strategy.call(self) else nil end end |
#converter_methods ⇒ Object
28 29 30 |
# File 'lib/yaoc/mapping_base.rb', line 28 def converter_methods self.class.converter_methods end |
#fetcher ⇒ Object
32 33 34 |
# File 'lib/yaoc/mapping_base.rb', line 32 def fetcher defined?(super) ? super : :fetch end |
#to_proc ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/yaoc/mapping_base.rb', line 8 def to_proc ->(to_convert){ old_to_convert = self.to_convert begin self.to_convert = to_convert call ensure self.to_convert = old_to_convert end } end |