Sha256: abaff5103484d4f7e7dcbf46288c963b4fda1ca844b16df82b8b1508dcd07c60

Contents?: true

Size: 452 Bytes

Versions: 5

Compression:

Stored size: 452 Bytes

Contents

require 'ostruct'

module FplGsheet
  class Player < OpenStruct # as in, football player, not an FPL manager
    #attr_reader :details

    def initialize(raw_hash, databank)
      super(raw_hash)
      @databank = databank
    end
    
    def full_name
      self.first_name + ' ' + self.second_name
    end
    
    def price # FPL stores £5.4m as 54, let's change it back
      (self.now_cost.to_f/10).round(1)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fpl_gsheet-0.3.2 lib/fpl_gsheet/player.rb
fpl_gsheet-0.3.1 lib/fpl_gsheet/player.rb
fpl_gsheet-0.3.0 lib/fpl_gsheet/player.rb
fpl_gsheet-0.2.0 lib/fpl_gsheet/player.rb
fpl_gsheet-0.1.1 lib/fpl_gsheet/player.rb