Sha256: f7437b7035bdd45259e5b928df381b48e4647a443923869806e336684920dee8

Contents?: true

Size: 287 Bytes

Versions: 14

Compression:

Stored size: 287 Bytes

Contents

# frozen_string_literal: true

class Pokemon
  class Decorator < Azeroth::Decorator
    expose :name
    expose :previous_form_name, as: :evolution_of, if: :evolution?

    def evolution?
      previous_form
    end

    def previous_form_name
      previous_form.name
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
azeroth-1.0.0 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.10.1 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.10.0 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.9.0 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.8.2 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.8.1 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.8.0 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.7.4 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.7.3 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.7.2 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.7.1 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.7.0 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.6.5 spec/dummy/app/models/pokemon/decorator.rb
azeroth-0.6.4 spec/dummy/app/models/pokemon/decorator.rb