Class: FplGsheet::Player

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/fpl_gsheet/player.rb

Overview

as in, football player, not an FPL manager

Instance Method Summary collapse

Constructor Details

#initialize(raw_hash, databank) ⇒ Player

attr_reader :details



7
8
9
10
# File 'lib/fpl_gsheet/player.rb', line 7

def initialize(raw_hash, databank)
  super(raw_hash)
  @databank = databank
end

Instance Method Details

#full_nameObject



12
13
14
# File 'lib/fpl_gsheet/player.rb', line 12

def full_name
  self.first_name + ' ' + self.second_name
end

#priceObject

FPL stores £5.4m as 54, let’s change it back



16
17
18
# File 'lib/fpl_gsheet/player.rb', line 16

def price # FPL stores £5.4m as 54, let's change it back

  (self.now_cost.to_f/10).round(1)
end