Sha256: e008aafb86cce27060431d5bfe572197988ec782242cfc731f89329190bfc0c2

Contents?: true

Size: 602 Bytes

Versions: 3

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, class: ::House
    expose :old_house, class: ::House, cached: true
    expose :games, class: ::Game
    expose :games_filtered, class: ::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

3 entries across 3 versions & 1 rubygems

Version Path
arstotzka-1.0.4 spec/support/models/arstotzka/dummy.rb
arstotzka-1.0.3 spec/support/models/arstotzka/dummy.rb
arstotzka-1.0.2 spec/support/models/arstotzka/dummy.rb