Exception: Graphiti::Errors::AttributeError
- Defined in:
- lib/graphiti/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#exists ⇒ Object
readonly
Returns the value of attribute exists.
-
#flag ⇒ Object
readonly
Returns the value of attribute flag.
-
#guard ⇒ Object
readonly
Returns the value of attribute guard.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #action ⇒ Object
-
#initialize(resource, name, flag, **opts) ⇒ AttributeError
constructor
A new instance of AttributeError.
- #message ⇒ Object
- #resource_name ⇒ Object
Constructor Details
#initialize(resource, name, flag, **opts) ⇒ AttributeError
Returns a new instance of AttributeError.
311 312 313 314 315 316 |
# File 'lib/graphiti/errors.rb', line 311 def initialize(resource, name, flag, **opts) @resource = resource @name = name @flag = flag @request = opts[:request] || false end |
Instance Attribute Details
#exists ⇒ Object (readonly)
Returns the value of attribute exists.
304 305 306 |
# File 'lib/graphiti/errors.rb', line 304 def exists @exists end |
#flag ⇒ Object (readonly)
Returns the value of attribute flag.
304 305 306 |
# File 'lib/graphiti/errors.rb', line 304 def flag @flag end |
#guard ⇒ Object (readonly)
Returns the value of attribute guard.
304 305 306 |
# File 'lib/graphiti/errors.rb', line 304 def guard @guard end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
304 305 306 |
# File 'lib/graphiti/errors.rb', line 304 def name @name end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
304 305 306 |
# File 'lib/graphiti/errors.rb', line 304 def request @request end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
304 305 306 |
# File 'lib/graphiti/errors.rb', line 304 def resource @resource end |
Instance Method Details
#action ⇒ Object
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/graphiti/errors.rb', line 318 def action if @request { sortable: "sort on", filterable: "filter on", readable: "read", writable: "write" }[@flag] else { sortable: "add sort", filterable: "add filter", readable: "read", writable: "write" }[@flag] end end |
#message ⇒ Object
345 346 347 |
# File 'lib/graphiti/errors.rb', line 345 def "#{resource_name}: Tried to #{action} attribute #{@name.inspect}" end |