Module: ThePlatform::Configuration
- Extended by:
- Configuration
- Included in:
- Configuration, Data, Identity
- Defined in:
- lib/theplatform/configuration.rb
Overview
Module to extend to other Classes in order to set up #configuration on a per object basis
Instance Attribute Summary collapse
-
#_duration ⇒ Object
Returns the value of attribute _duration.
-
#_idleTimeout ⇒ Object
Returns the value of attribute _idleTimeout.
-
#form ⇒ Object
Returns the value of attribute form.
-
#password ⇒ Object
Returns the value of attribute password.
-
#schema ⇒ Object
Returns the value of attribute schema.
-
#token ⇒ Object
Returns the value of attribute token.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Allows for a Rails type configuration setup.
-
#parameters ⇒ Object
List available parameters and values in those params.
-
#parameters? ⇒ Boolean
Returns true or false if all parameters are set.
Instance Attribute Details
#_duration ⇒ Object
Returns the value of attribute _duration.
8 9 10 |
# File 'lib/theplatform/configuration.rb', line 8 def _duration @_duration end |
#_idleTimeout ⇒ Object
Returns the value of attribute _idleTimeout.
8 9 10 |
# File 'lib/theplatform/configuration.rb', line 8 def _idleTimeout @_idleTimeout end |
#form ⇒ Object
Returns the value of attribute form.
8 9 10 |
# File 'lib/theplatform/configuration.rb', line 8 def form @form end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/theplatform/configuration.rb', line 8 def password @password end |
#schema ⇒ Object
Returns the value of attribute schema.
8 9 10 |
# File 'lib/theplatform/configuration.rb', line 8 def schema @schema end |
#token ⇒ Object
Returns the value of attribute token.
8 9 10 |
# File 'lib/theplatform/configuration.rb', line 8 def token @token end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/theplatform/configuration.rb', line 8 def username @username end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Allows for a Rails type configuration setup. Different object make different configurations.
ThePlatform::Data.configure do |config|
config.schema = '1.4.0'
config.form = 'cjson'
config.token = 'o4VThP--IcaKwltckmgdw544KD0kKDg'
end
=> {:schema=>"1.4.0", :form=>"json", :token=>"o4VThP--IcaKwltckmgdw544KD0kKDg"}
19 20 21 22 |
# File 'lib/theplatform/configuration.rb', line 19 def configure yield self parameters end |
#parameters ⇒ Object
List available parameters and values in those params
25 26 27 28 29 |
# File 'lib/theplatform/configuration.rb', line 25 def parameters @values = {} keys.each { |k| @values.merge! k => get_var(k) unless get_var(k) == nil } @values end |
#parameters? ⇒ Boolean
Returns true or false if all parameters are set.
32 33 34 |
# File 'lib/theplatform/configuration.rb', line 32 def parameters? parameters.keys == keys end |