Skip to content

Commit ae6c84a

Browse files
committed
Makes private type-based pragma helper methods public.
As discussed in #136, the type-based getter and setter helper methods for pragmas are public now. This allows direct usage in case there are no specific methods for a pragma.
1 parent ee010db commit ae6c84a

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

lib/sqlite3/pragmas.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module Pragmas
1313
def get_boolean_pragma( name )
1414
get_first_value( "PRAGMA #{name}" ) != "0"
1515
end
16-
private :get_boolean_pragma
1716

1817
# Sets the given pragma to the given boolean value. The value itself
1918
# may be +true+ or +false+, or any other commonly used string or
@@ -39,7 +38,6 @@ def set_boolean_pragma( name, mode )
3938

4039
execute( "PRAGMA #{name}=#{mode}" )
4140
end
42-
private :set_boolean_pragma
4341

4442
# Requests the given pragma (and parameters), and if the block is given,
4543
# each row of the result set will be yielded to it. Otherwise, the results
@@ -52,13 +50,11 @@ def get_query_pragma( name, *parms, &block ) # :yields: row
5250
execute( "PRAGMA #{name}( #{args} )", &block )
5351
end
5452
end
55-
private :get_query_pragma
5653

5754
# Return the value of the given pragma.
5855
def get_enum_pragma( name )
5956
get_first_value( "PRAGMA #{name}" )
6057
end
61-
private :get_enum_pragma
6258

6359
# Set the value of the given pragma to +mode+. The +mode+ parameter must
6460
# conform to one of the values in the given +enum+ array. Each entry in
@@ -71,20 +67,17 @@ def set_enum_pragma( name, mode, enums )
7167
"unrecognized #{name} #{mode.inspect}" unless match
7268
execute( "PRAGMA #{name}='#{match.first.upcase}'" )
7369
end
74-
private :set_enum_pragma
7570

7671
# Returns the value of the given pragma as an integer.
7772
def get_int_pragma( name )
7873
get_first_value( "PRAGMA #{name}" ).to_i
7974
end
80-
private :get_int_pragma
8175

8276
# Set the value of the given pragma to the integer value of the +value+
8377
# parameter.
8478
def set_int_pragma( name, value )
8579
execute( "PRAGMA #{name}=#{value.to_i}" )
8680
end
87-
private :set_int_pragma
8881

8982
# The enumeration of valid synchronous modes.
9083
SYNCHRONOUS_MODES = [ [ 'full', 2 ], [ 'normal', 1 ], [ 'off', 0 ] ]

0 commit comments

Comments
 (0)