Module: Isomorfeus

Defined in:
lib/isomorfeus-react.rb,
lib/isomorfeus/config.rb,
lib/isomorfeus/top_level.rb,
lib/isomorfeus/view_helpers.rb

Defined Under Namespace

Modules: Model, ViewHelpers Classes: TopLevel

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.initialized?Object (readonly)

Returns the value of attribute initialized?.



4
5
6
# File 'lib/isomorfeus/config.rb', line 4

def initialized?
  @initialized?
end

.prerenderingObject

Returns the value of attribute prerendering.



35
36
37
# File 'lib/isomorfeus/config.rb', line 35

def prerendering
  @prerendering
end

.storeObject (readonly)

Returns the value of attribute store.



5
6
7
# File 'lib/isomorfeus/config.rb', line 5

def store
  @store
end

Class Method Details

.add_client_init_class_name(init_class_name) ⇒ Object



17
18
19
# File 'lib/isomorfeus/config.rb', line 17

def add_client_init_class_name(init_class_name)
  client_init_class_names << init_class_name
end

.add_client_option(key, value = nil) ⇒ Object



21
22
23
24
# File 'lib/isomorfeus/config.rb', line 21

def add_client_option(key, value = nil)
  self.class.attr_accessor(key)
  self.send("#{key}=", value)
end

.configuration(&block) ⇒ Object



37
38
39
# File 'lib/isomorfeus/config.rb', line 37

def configuration(&block)
  block.call(self)
end

.execute_init_classesObject



26
27
28
29
30
# File 'lib/isomorfeus/config.rb', line 26

def execute_init_classes
  client_init_class_names.each do |constant|
    constant.constantize.send(:init)
  end
end

.initObject



7
8
9
10
11
12
13
14
15
# File 'lib/isomorfeus/config.rb', line 7

def init
  return if initialized?
  @initialized = true
  # at least one reducer must have been added at this stage
  # this happened in isomorfeus-react.rb, where the component reducers were added
  @store = Redux::Store.init!
  `Opal.Isomorfeus.store = #@store`
  execute_init_classes
end

.versionObject



41
42
43
# File 'lib/isomorfeus/config.rb', line 41

def version
  Isomorfeus::VERSION
end