Sha256: 5a0811a34b25bbdf52eb7092645750388e4746d9a4930f36c0f8c0794e094e55

Contents?: true

Size: 882 Bytes

Versions: 3

Compression:

Stored size: 882 Bytes

Contents

module KonoUtils::Object::Cell # namespace
  class Show < Base

    # @param field [KonoUtilsBootstrapView4::EditableField] campo da cui estrapolare il valore
    def get_field(field)
      model.send(field.name)
    end

    # @param field [KonoUtilsBootstrapView4::EditableField] campo da cui estrapolare la descrizione
    def field_description(field)
      model.class.han field.name
    end

    ##
    # Elenco dei campi da visualizzare, altrimenti estrapolati dalla policy
    # @return [Array<KonoUtilsBootstrapView4::EditableField>]
    def displayable_attributes
      if options[:displayable_attributes]
        KonoUtilsBootstrapView4::EditableField.editable_fields_to_field_array(options[:displayable_attributes])
      else
        KonoUtilsBootstrapView4::EditableField.editable_fields_to_field_array(policy(model).displayable_attributes)
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kono_utils_bootstrap_view4-0.1.0.pre.rc.3 app/concepts/kono_utils/object/cell/show.rb
kono_utils_bootstrap_view4-0.1.0.pre.rc.2 app/concepts/kono_utils/object/cell/show.rb
kono_utils_bootstrap_view4-0.1.0.pre.rc.1 app/concepts/kono_utils/object/cell/show.rb