Module: Params::Base

Included in:
Decoder, Encoder
Defined in:
lib/params/base.rb

Instance Method Summary collapse

Instance Method Details

#clean_params(params) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/params/base.rb', line 3

def clean_params params
  Hash[params.collect do |key, value|
    value = nil if value == "na"
    [key, value]
    end
  ]
end

#crypter?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/params/base.rb', line 15

def crypter?
  !(@crypter == false)
end

#crypter_off!Object



19
20
21
# File 'lib/params/base.rb', line 19

def crypter_off!
  @crypter = false
end

#crypter_on!Object



23
24
25
# File 'lib/params/base.rb', line 23

def crypter_on!
  @crypter = true
end

#use_crypter?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/params/base.rb', line 11

def use_crypter?
  crypter? || Params::Crypter.on?
end