Sha256: 2346f11a4df36e76c2fba5560a03afa1a65cb445d335318e9a2702b14388928b

Contents?: true

Size: 803 Bytes

Versions: 14

Compression:

Stored size: 803 Bytes

Contents

class PeakFlowUtils::AttributeService
  attr_reader :name, :model_inspector

  def initialize(model_inspector, name)
    @model_inspector = model_inspector
    @name = name
  end

  def i18n_key
    "activerecord.attributes.#{@model_inspector.snake_name}.#{@name}"
  end

  def simple_form_include_blank_key
    "simple_form.include_blanks.#{@model_inspector.snake_name}.#{@name}"
  end

  def simple_form_label_key
    "simple_form.labels.#{@model_inspector.snake_name}.#{@name}"
  end

  def simple_form_hint_key
    "simple_form.hints.#{@model_inspector.snake_name}.#{@name}"
  end

  def simple_form_placeholder_key
    "simple_form.placeholders.#{@model_inspector.snake_name}.#{@name}"
  end

  def simple_form_prompt_key
    "simple_form.prompts.#{@model_inspector.snake_name}.#{@name}"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
peak_flow_utils-0.1.19 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.18 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.17 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.16 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.15 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.14 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.13 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.12 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.11 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.10 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.9 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.8 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.7 app/services/peak_flow_utils/attribute_service.rb
peak_flow_utils-0.1.6 app/services/peak_flow_utils/attribute_service.rb