Sha256: b9c57b4b10641466339fa3d3944cfc4f70f14c5b94da756b9ba8d663732c7d6b

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

class Arstotzka::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.select do |g|
      g.publisher != 'sega'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arstotzka-1.0.1 spec/support/models/arstotzka/dummy.rb
arstotzka-1.0.0 spec/support/models/arstotzka/dummy.rb