Class: Representable::ParseStrategy
- Inherits:
-
Object
- Object
- Representable::ParseStrategy
- Defined in:
- lib/representable/parse_strategies.rb
Overview
Parse strategies are just a combination of representable’s options. They save you from memoizing the necessary parameters.
Feel free to contribute your strategy if you think it’s worth sharing!
Defined Under Namespace
Classes: FindOrInstantiate, Proc, Sync
Class Method Summary collapse
Class Method Details
.apply!(options) ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/representable/parse_strategies.rb', line 41 def self.apply!() return unless strategy = [:parse_strategy] warn "[Representable] :parse_strategy is deprecated. Please use a populator." strategy = :proc if strategy.is_a?(::Proc) parse_strategies[strategy].apply!(name, ) end |
.parse_strategies ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/representable/parse_strategies.rb', line 51 def self.parse_strategies { :sync => Sync, :find_or_instantiate => FindOrInstantiate, :proc => Proc } end |