Class: Frails::Component::React

Inherits:
Abstract
  • Object
show all
Defined in:
lib/frails/component/react.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Abstract

after_render, before_render, #method_missing

Constructor Details

#initialize(view, path, options) ⇒ React

Returns a new instance of React.



6
7
8
9
10
11
12
13
14
# File 'lib/frails/component/react.rb', line 6

def initialize(view, path, options)
  super

  @class_name = @options.fetch(:class, nil)
  @props = @options.fetch(:props, {})
  @tag = @options.fetch(:tag, :div)
  @prerender = @options.fetch(:prerender, false)
  @content_loader = @options.fetch(:content_loader, false)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Frails::Component::Abstract

Instance Attribute Details

#class_nameObject

Returns the value of attribute class_name.



4
5
6
# File 'lib/frails/component/react.rb', line 4

def class_name
  @class_name
end

#content_loaderObject

Returns the value of attribute content_loader.



4
5
6
# File 'lib/frails/component/react.rb', line 4

def content_loader
  @content_loader
end

#prerenderObject

Returns the value of attribute prerender.



4
5
6
# File 'lib/frails/component/react.rb', line 4

def prerender
  @prerender
end

#propsObject

Returns the value of attribute props.



4
5
6
# File 'lib/frails/component/react.rb', line 4

def props
  @props
end

#tagObject

Returns the value of attribute tag.



4
5
6
# File 'lib/frails/component/react.rb', line 4

def tag
  @tag
end