Skip to content

Inconsistent formating in Result#inspect #79

@jage

Description

@jage
#<Twingly::Search::Result:0x3fc870543c10 @posts, @number_of_matches_returned=1000, @number_of_matches_total=2847@incomplete_result=false>

matches = "@posts, "
matches << "@number_of_matches_returned=#{self.number_of_matches_returned}, "
matches << "@number_of_matches_total=#{self.number_of_matches_total}"
matches << "@incomplete_result=#{self.incomplete?}"
sprintf("#<%s:0x%x %s>", self.class.name, __id__, matches)

and:

instance_variables = "@posts, "
instance_variables << "@ts=#{self.ts}, "
instance_variables << "@from=#{self.from}, "
instance_variables << "@number_of_posts=#{self.number_of_posts}, "
instance_variables << "@max_number_of_posts=#{self.max_number_of_posts}, "
instance_variables << "@first_post=#{self.first_post}, "
instance_variables << "@last_post=#{self.last_post}"
instance_variables << "@next_timestamp=#{self.next_timestamp}"
sprintf("#<%s:0x%x %s>", self.class.name, __id__, instance_variables)

We should probably do something like this instead:

[
  "@posts",
  "@number_of_matches_returned=#{self.number_of_matches_returned}",
  "@number_of_matches_total=#{self.number_of_matches_total}",
  "@incomplete_result=#{self.incomplete?}",
].join(", ")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions