Class: VueCK::SFC
- Inherits:
-
Object
- Object
- VueCK::SFC
- Defined in:
- lib/sfc.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#script ⇒ Object
Returns the value of attribute script.
-
#style ⇒ Object
Returns the value of attribute style.
-
#template ⇒ Object
Returns the value of attribute template.
-
#xml ⇒ Object
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(component_file) ⇒ SFC
constructor
A new instance of SFC.
- #render_component ⇒ Object
- #render_style ⇒ Object
Constructor Details
#initialize(component_file) ⇒ SFC
Returns a new instance of SFC.
5 6 7 8 9 |
# File 'lib/sfc.rb', line 5 def initialize(component_file) @path = component_file @xml = component_xml @name = @xml.attribute(ATTRIBUTES[:name]).value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/sfc.rb', line 3 def name @name end |
#script ⇒ Object
Returns the value of attribute script.
3 4 5 |
# File 'lib/sfc.rb', line 3 def script @script end |
#style ⇒ Object
Returns the value of attribute style.
3 4 5 |
# File 'lib/sfc.rb', line 3 def style @style end |
#template ⇒ Object
Returns the value of attribute template.
3 4 5 |
# File 'lib/sfc.rb', line 3 def template @template end |
#xml ⇒ Object
Returns the value of attribute xml.
3 4 5 |
# File 'lib/sfc.rb', line 3 def xml @xml end |
Instance Method Details
#render_component ⇒ Object
11 12 13 |
# File 'lib/sfc.rb', line 11 def render_component reduce_whitespace "var #{@name} = Vue.component('#{@name}',{template:'#{render(:template)}', #{render(:script)}});" end |