Class: DummyFormObject

Inherits:
OpenStruct
  • Object
show all
Defined in:
app/models/dummy_form_object.rb

Direct Known Subclasses

NameDummyFormObject

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.human_attribute_name(attribute) ⇒ Object



9
10
11
# File 'app/models/dummy_form_object.rb', line 9

def self.human_attribute_name(attribute)
  attribute.to_s.titleize
end

.model_nameObject



2
3
4
5
6
7
# File 'app/models/dummy_form_object.rb', line 2

def self.model_name
  OpenStruct.new({
    to_s: "Test Dummy",
    param_key: "test_dummy"
  })
end

Instance Method Details

#errorsObject



13
14
15
16
17
18
19
# File 'app/models/dummy_form_object.rb', line 13

def errors
  if self.has_errors
    HashWithIndifferentAccess.new(["has an error"])
  else
    HashWithIndifferentAccess.new([])
  end
end