Sha256: bda92b1716b0c7dd8d251248af14133af6932f1f212fe08752e194c657f1f615

Contents?: true

Size: 602 Bytes

Versions: 7

Compression:

Stored size: 602 Bytes

Contents

# frozen_string_literal: true

module Arstotzka
  class Dummy
    include Arstotzka
    attr_reader :json

    expose :id
    expose :name, path: 'user'
    expose :father_name, full_path: 'father.name'
    expose :age, cached: true
    expose :house, klass: ::House
    expose :old_house, klass: ::House, cached: true
    expose :games, klass: ::Game
    expose :games_filtered, klass: ::Game, after: :filter_games, full_path: 'games'

    def initialize(json)
      @json = json
    end

    def filter_games(games)
      games.reject do |g|
        g.publisher == 'sega'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arstotzka-1.3.0 spec/support/models/arstotzka/dummy.rb
arstotzka-1.2.4 spec/support/models/arstotzka/dummy.rb
arstotzka-1.2.3 spec/support/models/arstotzka/dummy.rb
arstotzka-1.2.2 spec/support/models/arstotzka/dummy.rb
arstotzka-1.2.1 spec/support/models/arstotzka/dummy.rb
arstotzka-1.2.0 spec/support/models/arstotzka/dummy.rb
arstotzka-1.1.0 spec/support/models/arstotzka/dummy.rb