Class: OpenComponents::PrerenderedComponent

Inherits:
Component
  • Object
show all
Defined in:
lib/opencomponents/prerendered_component.rb

Instance Attribute Summary collapse

Attributes inherited from Component

#href, #name, #params, #registry_version, #render_mode, #type, #version

Instance Method Summary collapse

Methods inherited from Component

#flush!, #initialize, #reload!, #request_version

Constructor Details

This class inherits a constructor from OpenComponents::Component

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/opencomponents/prerendered_component.rb', line 3

def data
  @data
end

#templateObject (readonly)

Returns the value of attribute template.



3
4
5
# File 'lib/opencomponents/prerendered_component.rb', line 3

def template
  @template
end

Instance Method Details

#loadObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/opencomponents/prerendered_component.rb', line 5

def load
  template_data = response_data['template']

  @data     = response_data['data']
  @template = Template.new(
    template_data['src'], template_data['type'], template_data['key']
  )

  super
end