Class: ClowneActiveStorage::Declarations::IncludeAttached

Inherits:
Clowne::Declarations::Base
  • Object
show all
Defined in:
lib/clowne_active_storage/declarations/include_attached.rb

Overview

DSL to add associations to ActiveStorage Attachments and Blobs for single attachments

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ IncludeAttached

Returns a new instance of IncludeAttached.



10
11
12
# File 'lib/clowne_active_storage/declarations/include_attached.rb', line 10

def initialize(name)
  @name = name.to_sym
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/clowne_active_storage/declarations/include_attached.rb', line 8

def name
  @name
end

Instance Method Details

#compile(plan) ⇒ Object



14
15
16
# File 'lib/clowne_active_storage/declarations/include_attached.rb', line 14

def compile(plan)
  plan.set :attachment_association, self
end