Class: FbErrorMachine::GraphApiError
- Defined in:
- lib/fb_error_machine/graph_api_error.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#error_code ⇒ Object
Returns the value of attribute error_code.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
Class Method Summary collapse
Methods inherited from ErrorBase
Constructor Details
This class inherits a constructor from FbErrorMachine::ErrorBase
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/fb_error_machine/graph_api_error.rb', line 5 def description @description end |
#error_code ⇒ Object
Returns the value of attribute error_code.
5 6 7 |
# File 'lib/fb_error_machine/graph_api_error.rb', line 5 def error_code @error_code end |
#instructions ⇒ Object
Returns the value of attribute instructions.
5 6 7 |
# File 'lib/fb_error_machine/graph_api_error.rb', line 5 def instructions @instructions end |
Class Method Details
.all ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/fb_error_machine/graph_api_error.rb', line 7 def self.all @_errors ||= begin YAML.load_file(File.join(File.dirname(__FILE__), "graph_api_errors.yml")).map do |entry| GraphApiError.new(entry) end rescue Psych::SyntaxError, Errno::EACCES, Errno::ENOENT {} end end |
.find(error_code) ⇒ Object
17 18 19 |
# File 'lib/fb_error_machine/graph_api_error.rb', line 17 def self.find(error_code) GraphApiError.all.detect { |e| e.error_code == error_code.to_s } end |