Class: ClassStubber::ActiveStorageAttachmentSingle
- Inherits:
-
Object
- Object
- ClassStubber::ActiveStorageAttachmentSingle
- Defined in:
- lib/generators/rider_kick/templates/spec/support/class_stubber.rb
Overview
Single file attachment stub
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #attached? ⇒ Boolean
- #blank? ⇒ Boolean
-
#initialize(url) ⇒ ActiveStorageAttachmentSingle
constructor
A new instance of ActiveStorageAttachmentSingle.
- #present? ⇒ Boolean
Constructor Details
#initialize(url) ⇒ ActiveStorageAttachmentSingle
Returns a new instance of ActiveStorageAttachmentSingle.
72 73 74 |
# File 'lib/generators/rider_kick/templates/spec/support/class_stubber.rb', line 72 def initialize(url) @url = url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
70 71 72 |
# File 'lib/generators/rider_kick/templates/spec/support/class_stubber.rb', line 70 def url @url end |
Instance Method Details
#attached? ⇒ Boolean
76 77 78 |
# File 'lib/generators/rider_kick/templates/spec/support/class_stubber.rb', line 76 def attached? !@url.nil? end |
#blank? ⇒ Boolean
80 81 82 |
# File 'lib/generators/rider_kick/templates/spec/support/class_stubber.rb', line 80 def blank? !attached? end |
#present? ⇒ Boolean
84 85 86 |
# File 'lib/generators/rider_kick/templates/spec/support/class_stubber.rb', line 84 def present? attached? end |