Class: RspecSqlCounter::SqlFetcher::SqlQueryInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec_sql_counter/sql_fetcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sqlObject

Returns the value of attribute sql

Returns:

  • (Object)

    the current value of sql



5
6
7
# File 'lib/rspec_sql_counter/sql_fetcher.rb', line 5

def sql
  @sql
end

#timesObject

Returns the value of attribute times

Returns:

  • (Object)

    the current value of times



5
6
7
# File 'lib/rspec_sql_counter/sql_fetcher.rb', line 5

def times
  @times
end

#type_casted_bindsObject

Returns the value of attribute type_casted_binds

Returns:

  • (Object)

    the current value of type_casted_binds



5
6
7
# File 'lib/rspec_sql_counter/sql_fetcher.rb', line 5

def type_casted_binds
  @type_casted_binds
end

Instance Method Details

#pretty_to_sString

Pretty SqlHelper::SqlQueryInfo

Returns:

  • (String)

    Pretty text



9
10
11
12
13
14
15
# File 'lib/rspec_sql_counter/sql_fetcher.rb', line 9

def pretty_to_s
  if type_casted_binds.present?
    "#{times} times: #{sql} with values #{type_casted_binds}"
  else
    "#{times} times: #{sql}"
  end
end