lib/alma/fine_set.rb in alma-0.2.6 vs lib/alma/fine_set.rb in alma-0.2.8

- old
+ new

@@ -3,22 +3,26 @@ extend Forwardable include Enumerable #include Alma::Error attr_reader :response - def_delegators :list, :each, :size def_delegators :response, :[], :fetch def initialize(response_body_hash) @response = response_body_hash end def key 'fee' end - def list - fetch(key, []) + def each + @response.fetch(key, []).map{|item| Alma::AlmaRecord.new(item)} + end + alias list each + + def size + each.count end def sum fetch('total_sum', 0) end