Module: Representable::Binding::Deprecation::EvaluateOption
- Defined in:
- lib/representable/deprecations.rb
Class Method Summary collapse
Instance Method Summary collapse
- #compile_fragment(options) ⇒ Object
- #evaluate_option(name, input = nil, options = {}) ⇒ Object
-
#get(options = {}) ⇒ Object
DISCUSS: evluate if we really need this.
- #represented ⇒ Object
-
#uncompile_fragment(options) ⇒ Object
Parse value from doc and update the model property.
Class Method Details
Instance Method Details
#compile_fragment(options) ⇒ Object
109 110 111 112 113 |
# File 'lib/representable/deprecations.rb', line 109 def compile_fragment() @represented = [:represented] @parent_decorator = [:decorator] super end |
#evaluate_option(name, input = nil, options = {}) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/representable/deprecations.rb', line 42 def evaluate_option(name, input=nil, ={}) return evaluate_option_with_deprecation(name, input, , :user_options) if name==:as return evaluate_option_with_deprecation(name, input, , :user_options) if name==:if return evaluate_option_with_deprecation(name, input, , :user_options) if name==:getter return evaluate_option_with_deprecation(name, input, , :doc, :user_options) if name==:writer return evaluate_option_with_deprecation(name, input, , :input, :user_options) if name==:skip_render return evaluate_option_with_deprecation(name, input, , :input, :user_options) if name==:skip_parse return evaluate_option_with_deprecation(name, input, , :input, :user_options) if name==:serialize return evaluate_option_with_deprecation(name, input, , :doc, :user_options) if name==:reader return evaluate_option_with_deprecation(name, input, , :input, :index, :user_options) if name==:instance return evaluate_option_with_deprecation(name, input, , :input, :index, :user_options) if name==:class return evaluate_option_with_deprecation(name, input, , :input, :fragment, :user_options) if name==:deserialize return evaluate_option_with_deprecation(name, input, , :input, :user_options) if name==:prepare return evaluate_option_with_deprecation(name, input, , :input, :user_options) if name==:extend return evaluate_option_with_deprecation(name, input, , :input, :user_options) if name==:setter end |
#get(options = {}) ⇒ Object
DISCUSS: evluate if we really need this.
122 123 124 125 |
# File 'lib/representable/deprecations.rb', line 122 def get(={}) # DISCUSS: evluate if we really need this. warn "[Representable] Binding#get is deprecated." self[:getter] ? Representable::Getter.(nil, .merge(binding: self)) : Representable::GetValue.(nil, .merge(binding: self)) end |
#represented ⇒ Object
104 105 106 107 |
# File 'lib/representable/deprecations.rb', line 104 def represented warn "[Representable] Binding#represented is deprecated. Use options[:represented] instead." @represented end |
#uncompile_fragment(options) ⇒ Object
Parse value from doc and update the model property.
116 117 118 119 120 |
# File 'lib/representable/deprecations.rb', line 116 def uncompile_fragment() @represented = [:represented] @parent_decorator = [:decorator] super end |