Class: Myra::Violation

Inherits:
Object
  • Object
show all
Defined in:
lib/myra/objects/violation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property, message) ⇒ Violation

Returns a new instance of Violation.



6
7
8
9
# File 'lib/myra/objects/violation.rb', line 6

def initialize(property, message)
  @property = property
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/myra/objects/violation.rb', line 4

def message
  @message
end

#propertyObject (readonly)

Returns the value of attribute property.



4
5
6
# File 'lib/myra/objects/violation.rb', line 4

def property
  @property
end

Class Method Details

.from_hash(violation) ⇒ Object



11
12
13
# File 'lib/myra/objects/violation.rb', line 11

def self.from_hash(violation)
  new(violation['propertyPath'], violation['message'])
end