Sha256: e5d90f426da6f0fb626f50da83c744eab7d9eb709251f3e3aa478e2a78b67e4d

Contents?: true

Size: 299 Bytes

Versions: 19

Compression:

Stored size: 299 Bytes

Contents

module Carnival::FieldRenderers
  class FieldRenderer
    def initialize(presenter, field_name)
      @presenter = presenter
      @field_name = field_name
    end

    def render_field(model)
     { field_type: @presenter.field_type(@field_name), value: model.send(@field_name) }
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
carnival-0.2.8 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.2.7 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.2.6 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.2.5 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.2.4 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.2.3 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.10 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.2.2 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.2.1 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.2.0 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.9 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.8 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.7 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.6 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.5 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.3 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.2 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.1 app/helpers/carnival/field_renderers/field_renderer.rb
carnival-0.1.0 app/helpers/carnival/field_renderers/field_renderer.rb