Class: FplGsheet::Pick

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

Instance Method Summary collapse

Constructor Details

#initialize(input_hash) ⇒ Pick

Returns a new instance of Pick.



4
5
6
7
8
# File 'lib/fpl_gsheet/pick.rb', line 4

def initialize(input_hash)

  @input_hash = input_hash
  #@fixtures = fixtures.map { |f| TeamFixture.new(f, @data['id']) }

end

Instance Method Details

#captain?Boolean

def selling_price

@input_hash['selling_price'].to_f/10).round(1)

end

Returns:

  • (Boolean)


18
# File 'lib/fpl_gsheet/pick.rb', line 18

def captain?; @input_hash['is_captain']; end

#multiplierObject



20
# File 'lib/fpl_gsheet/pick.rb', line 20

def multiplier; @input_hash['multiplier']; end

#on_bench?Boolean

the above 5 are the only ones that show up all the time, eg this page fantasy.premierleague.com/drf/entry/483663/event/1/picks There’s also this… fantasy.premierleague.com/drf/my-team/483663/ NUTS this is only if you are logged in :(

Returns:

  • (Boolean)


27
28
29
# File 'lib/fpl_gsheet/pick.rb', line 27

def on_bench? #not subsititue? cos you could be subbed on

  return @input_hash['position'] > 11
end

#player_idObject



10
11
12
# File 'lib/fpl_gsheet/pick.rb', line 10

def player_id
  @input_hash['element']
end

#vice_captain?Boolean

Returns:

  • (Boolean)


19
# File 'lib/fpl_gsheet/pick.rb', line 19

def vice_captain?; @input_hash['is_vice_captain']; end