Class: Satis::Attachments::Component
- Inherits:
-
Satis::ApplicationComponent
- Object
- ViewComponent::Base
- Satis::ApplicationComponent
- Satis::Attachments::Component
- Defined in:
- app/components/satis/attachments/component.rb
Instance Attribute Summary collapse
-
#attachments_options ⇒ Object
readonly
Returns the value of attribute attachments_options.
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#form ⇒ Object
readonly
Returns the value of attribute form.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Attributes inherited from Satis::ApplicationComponent
Instance Method Summary collapse
-
#initialize(model, attribute, **options) ⇒ Component
constructor
A new instance of Component.
- #model_sgid ⇒ Object
Methods inherited from Satis::ApplicationComponent
Constructor Details
#initialize(model, attribute, **options) ⇒ Component
Returns a new instance of Component.
6 7 8 9 10 11 12 |
# File 'app/components/satis/attachments/component.rb', line 6 def initialize(model, attribute, **) super() @form = [:form] @model = model || form.object @attribute = attribute @attachments_options = end |
Instance Attribute Details
#attachments_options ⇒ Object (readonly)
Returns the value of attribute attachments_options.
4 5 6 |
# File 'app/components/satis/attachments/component.rb', line 4 def @attachments_options end |
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
4 5 6 |
# File 'app/components/satis/attachments/component.rb', line 4 def attribute @attribute end |
#form ⇒ Object (readonly)
Returns the value of attribute form.
4 5 6 |
# File 'app/components/satis/attachments/component.rb', line 4 def form @form end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
4 5 6 |
# File 'app/components/satis/attachments/component.rb', line 4 def model @model end |
Instance Method Details
#model_sgid ⇒ Object
14 15 16 |
# File 'app/components/satis/attachments/component.rb', line 14 def model_sgid @model.to_sgid(expires_in: nil, for: "satis_attachments") end |