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.
336 337 338 339 340 341 |
# File 'lib/graphiti/errors.rb', line 336 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.
329 330 331 |
# File 'lib/graphiti/errors.rb', line 329 def exists @exists end |
#flag ⇒ Object (readonly)
Returns the value of attribute flag.
329 330 331 |
# File 'lib/graphiti/errors.rb', line 329 def flag @flag end |
#guard ⇒ Object (readonly)
Returns the value of attribute guard.
329 330 331 |
# File 'lib/graphiti/errors.rb', line 329 def guard @guard end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
329 330 331 |
# File 'lib/graphiti/errors.rb', line 329 def name @name end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
329 330 331 |
# File 'lib/graphiti/errors.rb', line 329 def request @request end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
329 330 331 |
# File 'lib/graphiti/errors.rb', line 329 def resource @resource end |
Instance Method Details
#action ⇒ Object
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/graphiti/errors.rb', line 343 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
370 371 372 |
# File 'lib/graphiti/errors.rb', line 370 def "#{resource_name}: Tried to #{action} attribute #{@name.inspect}" end |