Class: AngularSprinkles::FormBinder::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/angular_sprinkles/form_binder/base.rb

Direct Known Subclasses

CheckBox, Default

Instance Method Summary collapse

Constructor Details

#initialize(_args) ⇒ Base

Returns a new instance of Base.



4
5
6
7
8
9
10
11
12
# File 'lib/angular_sprinkles/form_binder/base.rb', line 4

def initialize(_args)
  @method = _args.fetch(:method)
  @args = _args.fetch(:args).dup

  object = _args.fetch(:object)
  attribute = @args.first.to_sym

  @attribute_binding = object.bind(attribute)
end

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
# File 'lib/angular_sprinkles/form_binder/base.rb', line 14

def call
  # Let the original form helper raise the exception
  if helper_is_going_raise_argument_error?
    return @args
  end

  augment_args
end