Class: ViewComponent::Template::Inline
- Inherits:
-
ViewComponent::Template
- Object
- ViewComponent::Template
- ViewComponent::Template::Inline
- Defined in:
- lib/view_component/template.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Attributes inherited from ViewComponent::Template
Instance Method Summary collapse
-
#initialize(component:, inline_template:) ⇒ Inline
constructor
A new instance of Inline.
- #type ⇒ Object
Methods inherited from ViewComponent::Template
#call_method_name, #compile_to_component, #default_format?, #inline_call?, #normalized_variant_name, #requires_compiled_superclass?, #safe_method_name, #safe_method_name_call
Constructor Details
#initialize(component:, inline_template:) ⇒ Inline
Returns a new instance of Inline.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/view_component/template.rb', line 45 def initialize(component:, inline_template:) details = ActionView::TemplateDetails.new(nil, inline_template.language.to_sym, nil, nil) super( component: component, details: details, path: inline_template.path, lineno: inline_template.lineno, ) @source = inline_template.source.dup end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
43 44 45 |
# File 'lib/view_component/template.rb', line 43 def source @source end |
Instance Method Details
#type ⇒ Object
58 59 60 |
# File 'lib/view_component/template.rb', line 58 def type :inline end |