Class: FplGsheet::Pick
- Inherits:
-
Object
- Object
- FplGsheet::Pick
- Defined in:
- lib/fpl_gsheet/pick.rb
Instance Method Summary collapse
-
#captain? ⇒ Boolean
def selling_price @input_hash.to_f/10).round(1) end.
-
#initialize(input_hash) ⇒ Pick
constructor
A new instance of Pick.
- #multiplier ⇒ Object
-
#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…
- #player_id ⇒ Object
- #vice_captain? ⇒ Boolean
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
18 |
# File 'lib/fpl_gsheet/pick.rb', line 18 def captain?; @input_hash['is_captain']; end |
#multiplier ⇒ Object
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 :(
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_id ⇒ Object
10 11 12 |
# File 'lib/fpl_gsheet/pick.rb', line 10 def player_id @input_hash['element'] end |
#vice_captain? ⇒ Boolean
19 |
# File 'lib/fpl_gsheet/pick.rb', line 19 def vice_captain?; @input_hash['is_vice_captain']; end |