Sha256: ab7dbeacecd65ebdcb2e3b19d4686c27518357452ee56fe6a6dc0bdc770b313d

Contents?: true

Size: 466 Bytes

Versions: 3

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

module Tramway::ApplicationForms::PropertiesObjectHelper
  def form_properties(**args)
    @form_properties = args
  end

  def properties
    @form_properties ||= {}
    yaml_config_file_path = Rails.root.join('app', 'forms', "#{self.class.name.underscore}.yml")

    return @form_properties unless File.exist? yaml_config_file_path

    @form_properties.deep_merge YAML.load_file(yaml_config_file_path).deep_symbolize_keys
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tramway-0.1.2 app/forms/tramway/application_forms/properties_object_helper.rb
tramway-0.1.1.1 app/forms/tramway/application_forms/properties_object_helper.rb
tramway-0.1.1 app/forms/tramway/application_forms/properties_object_helper.rb