Class: Abak::Flow::Configuration
- Inherits:
-
Object
- Object
- Abak::Flow::Configuration
- Includes:
- Ruler
- Defined in:
- lib/abak-flow/configuration.rb
Constant Summary collapse
- OPTIONS =
[:oauth_user, :oauth_token, :locale, :http_proxy].freeze
- LOCALE_FILES =
File.join(File.dirname(__FILE__), "locales/*.{rb,yml}").freeze
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #display_name ⇒ Object
-
#initialize(manager) ⇒ Configuration
constructor
A new instance of Configuration.
- #ready? ⇒ Boolean
Constructor Details
#initialize(manager) ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 |
# File 'lib/abak-flow/configuration.rb', line 14 def initialize(manager) @manager = manager @errors = [] configure! end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
12 13 14 |
# File 'lib/abak-flow/configuration.rb', line 12 def errors @errors end |
Instance Method Details
#display_name ⇒ Object
35 36 37 |
# File 'lib/abak-flow/configuration.rb', line 35 def display_name I18n.t("configuration.name") end |
#ready? ⇒ Boolean
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/abak-flow/configuration.rb', line 21 def ready? @errors = [] multi_ruleset do fact(:oauth_user_not_setup) { oauth_user.nil? } fact(:oauth_token_not_setup) { oauth_token.nil? } rule([:oauth_user_not_setup]) { @errors << I18n.t("configuration.errors.oauth_user_not_setup") } rule([:oauth_token_not_setup]) { @errors << I18n.t("configuration.errors.oauth_token_not_setup") } end @errors.empty? ? true : false end |