Skip to content

Comments

Create stats class#15257

Open
ondenman wants to merge 6 commits intomasterfrom
create-stats-class
Open

Create stats class#15257
ondenman wants to merge 6 commits intomasterfrom
create-stats-class

Conversation

@ondenman
Copy link
Contributor

Moving logic from term-table.rb to separate class.

@tmtmtmtm tmtmtmtm requested a deployment to everypolitician-viewe-pr-15257 August 31, 2016 15:20 Pending
@tmtmtmtm tmtmtmtm requested a deployment to everypolitician-viewe-pr-15257 August 31, 2016 15:21 Pending
@tmtmtmtm tmtmtmtm requested a deployment to everypolitician-viewe-pr-15257 August 31, 2016 15:45 Pending
@tmtmtmtm tmtmtmtm requested a deployment to everypolitician-viewe-pr-15257 August 31, 2016 15:46 Pending
Breaks steps from #group_data into separate classes to reduce complexity of original method.
Added reminder to reduce number of initializer arguments.
@ondenman ondenman force-pushed the create-stats-class branch from af47dbf to fa2698d Compare August 31, 2016 15:52
@tmtmtmtm tmtmtmtm requested a deployment to everypolitician-viewe-pr-15257 August 31, 2016 15:52 Pending
@tmtmtmtm tmtmtmtm requested a deployment to everypolitician-viewe-pr-15257 August 31, 2016 15:52 Pending
@ondenman ondenman changed the title WIP -- Create stats class Create stats class Aug 31, 2016
# frozen_string_literal: true
class TermStatistics
# TODO: reduce number of arguments
def initialize(term:, org_lookup:, people:)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what we want to do generally about documentation, but I think we definitely need to do something to explain what these arguments are. (And I strongly suspect that doing so would reveal org_lookup, at least, isn't really going to be a suitable thing to be passing around)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. After looking a little closer, I don't think people is obvious here either. I would naturally have assumed that that was going to be a list of EveryPolitician::Person objects, but nope!

@tmtmtmtm
Copy link
Contributor

I'm afraid I'm finding it really hard to puzzle out what this class represents. In particular, I can't easily tell what it gives me (and what I need to give it to get that). I suspect that 90% of this is a question of documentation, but I also suspect that writing that documentation will prove difficult enough to show that they might be wrong. (Adding unit tests for this may also show likewise…)

@tmtmtmtm tmtmtmtm assigned ondenman and unassigned tmtmtmtm Aug 31, 2016
@tmtmtmtm tmtmtmtm assigned tmtmtmtm and unassigned ondenman Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants