Module: SimpleInspect
- Included in:
- Itch::Auth, Itch::Bundle, Itch::Bundles, Itch::Client, Itch::Game, Itch::GameMap, Itch::Purchases, Itch::Review, Itch::Reviews, Itch::Reward, Itch::Rewards
- Defined in:
- lib/itch/simple_inspect.rb
Overview
Limit output of agent variable
Instance Method Summary collapse
Instance Method Details
#exclude_inspection ⇒ Object
19 20 21 |
# File 'lib/itch/simple_inspect.rb', line 19 def exclude_inspection [:agent] end |
#inspect ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/itch/simple_inspect.rb', line 5 def inspect attrs = pretty_print_instance_variables values = [ "#{self.class}##{object_id}", *attrs.map { |k| "#{k}: #{instance_variable_get(k)}" } ] "<#{values.join(" ")}>" end |
#pretty_print_instance_variables ⇒ Object
15 16 17 |
# File 'lib/itch/simple_inspect.rb', line 15 def pretty_print_instance_variables instance_variables.sort.reject { |i| exclude_inspection.include? i } end |