Class: InformantCommon::FieldError

Inherits:
Object
  • Object
show all
Defined in:
lib/informant-common/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.



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

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-common/field_error.rb', line 3

def message
  @message
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/informant-common/field_error.rb', line 4

def value
  @value
end

Instance Method Details

#as_json(*_args) ⇒ Object



16
17
18
# File 'lib/informant-common/field_error.rb', line 16

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