Class: InformantRails::FieldError

Inherits:
Object
  • Object
show all
Defined in:
lib/informant-rails/field_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value, message = nil) ⇒ FieldError

Returns a new instance of FieldError.



5
6
7
8
9
# File 'lib/informant-rails/field_error.rb', line 5

def initialize(name, value, message=nil)
  self.name = name
  self.value = value
  self.message = message
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/informant-rails/field_error.rb', line 3

def message
  @message
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/informant-rails/field_error.rb', line 3

def name
  @name
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/informant-rails/field_error.rb', line 3

def value
  @value
end

Instance Method Details

#as_json(*args) ⇒ Object



15
16
17
# File 'lib/informant-rails/field_error.rb', line 15

def as_json(*args)
  { name: name, value: value, message: message }
end