Class: HalInterpretation::ItemInterpreter
- Inherits:
-
Object
- Object
- HalInterpretation::ItemInterpreter
- Extended by:
- Forwardable
- Defined in:
- lib/hal_interpretation/item_interpreter.rb
Instance Method Summary collapse
-
#initialize(a_representation, opts) ⇒ ItemInterpreter
constructor
opts - named args :location - :interpreter -.
- #items ⇒ Object
- #problems ⇒ Object
Constructor Details
#initialize(a_representation, opts) ⇒ ItemInterpreter
opts - named args
:location -
:interpreter -
6 7 8 9 10 11 |
# File 'lib/hal_interpretation/item_interpreter.rb', line 6 def initialize(a_representation, opts) @repr = a_representation @location = opts.fetch(:location) { fail ArgumentError, "location is required" } @problems = [] @interpreter = opts.fetch(:interpreter) { fail ArgumentError, "interpreter is required" } end |
Instance Method Details
#items ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/hal_interpretation/item_interpreter.rb', line 13 def items interpret unless done? (raise InvalidRepresentationError.new problems) if problems.any? @items end |
#problems ⇒ Object
21 22 23 24 25 |
# File 'lib/hal_interpretation/item_interpreter.rb', line 21 def problems interpret unless done? @problems end |