Class: Traductor::Result
- Inherits:
-
Object
- Object
- Traductor::Result
- Defined in:
- lib/traductor/result.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
-
#initialize(results: {}, errors: []) ⇒ Result
constructor
A new instance of Result.
- #locales ⇒ Object
- #path_for(locale) ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(results: {}, errors: []) ⇒ Result
Returns a new instance of Result.
7 8 9 10 |
# File 'lib/traductor/result.rb', line 7 def initialize(results: {}, errors: []) @results = results @errors = errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/traductor/result.rb', line 5 def errors @errors end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
5 6 7 |
# File 'lib/traductor/result.rb', line 5 def results @results end |
Instance Method Details
#locales ⇒ Object
16 17 18 |
# File 'lib/traductor/result.rb', line 16 def locales @results.keys end |
#path_for(locale) ⇒ Object
20 21 22 |
# File 'lib/traductor/result.rb', line 20 def path_for(locale) @results[locale.to_s] end |
#success? ⇒ Boolean
12 13 14 |
# File 'lib/traductor/result.rb', line 12 def success? @errors.empty? end |