Class: JCR::Failure
- Inherits:
-
Object
- Object
- JCR::Failure
- Defined in:
- lib/jcr/evaluate_rules.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#definition ⇒ Object
Returns the value of attribute definition.
-
#evaluation ⇒ Object
Returns the value of attribute evaluation.
-
#json ⇒ Object
Returns the value of attribute json.
-
#json_elided ⇒ Object
Returns the value of attribute json_elided.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#pos ⇒ Object
Returns the value of attribute pos.
-
#reason_elided ⇒ Object
Returns the value of attribute reason_elided.
-
#rule ⇒ Object
Returns the value of attribute rule.
-
#stack_level ⇒ Object
Returns the value of attribute stack_level.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data, jcr, type, evaluation, stack_level) ⇒ Failure
constructor
A new instance of Failure.
Constructor Details
#initialize(data, jcr, type, evaluation, stack_level) ⇒ Failure
Returns a new instance of Failure.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/jcr/evaluate_rules.rb', line 84 def initialize data, jcr, type, evaluation, stack_level if type == "member" @json = "\"#{data[0]}\" : #{data[1].to_json} " else @json = data.to_json end @json_elided = JCR::elide(@json) @data = JCR::rule_data( data ) @rule = JCR::find_first_slice( jcr ) @pos = @rule.line_and_column @offset = @rule.offset @type = type @evaluation = evaluation @reason_elided = "unknown reason" @reason_elided = JCR::elide( @evaluation.reason ) if @evaluation.reason @definition = JCR::rule_def( type, jcr ) @stack_level = stack_level end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def data @data end |
#definition ⇒ Object
Returns the value of attribute definition.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def definition @definition end |
#evaluation ⇒ Object
Returns the value of attribute evaluation.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def evaluation @evaluation end |
#json ⇒ Object
Returns the value of attribute json.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def json @json end |
#json_elided ⇒ Object
Returns the value of attribute json_elided.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def json_elided @json_elided end |
#offset ⇒ Object
Returns the value of attribute offset.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def offset @offset end |
#pos ⇒ Object
Returns the value of attribute pos.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def pos @pos end |
#reason_elided ⇒ Object
Returns the value of attribute reason_elided.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def reason_elided @reason_elided end |
#rule ⇒ Object
Returns the value of attribute rule.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def rule @rule end |
#stack_level ⇒ Object
Returns the value of attribute stack_level.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def stack_level @stack_level end |
#type ⇒ Object
Returns the value of attribute type.
83 84 85 |
# File 'lib/jcr/evaluate_rules.rb', line 83 def type @type end |