Sha256: 7944f74730fa02102c94ea74ba9c9418fc4acab83ec3417041996aa649a249b5

Contents?: true

Size: 391 Bytes

Versions: 6

Compression:

Stored size: 391 Bytes

Contents

module AngularSprinkles
  class ModelDecorator < SimpleDelegator
    def initialize(args)
      @key = args.fetch(:key)
      @json_wrapper = args.fetch(:json_wrapper)
      @object_wrapper = args.fetch(:object_wrapper)

      object = args.fetch(:object)
      super(object)
    end

    def bind(attribute = nil)
      @object_wrapper.new(@key, attribute, @json_wrapper)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
angular_sprinkles-0.1.0 lib/angular_sprinkles/model_decorator.rb
angular_sprinkles-0.0.9 lib/angular_sprinkles/model_decorator.rb
angular_sprinkles-0.0.8 lib/angular_sprinkles/model_decorator.rb
angular_sprinkles-0.0.7 lib/angular_sprinkles/model_decorator.rb
angular_sprinkles-0.0.6 lib/angular_sprinkles/model_decorator.rb
angular_sprinkles-0.0.5 lib/angular_sprinkles/model_decorator.rb