Module: Wheel

Defined in:
lib/wheel.rb,
lib/wheel/store.rb,
lib/wheel/config.rb,
lib/wheel/engine.rb,
lib/wheel/railtie.rb,
lib/wheel/version.rb,
lib/wheel/application_record.rb,
app/models/wheel/application_record.rb,
app/controllers/wheel/configs_controller.rb,
lib/generators/wheel/install/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: ApplicationRecord, Config, ConfigsController, Engine, Error, Railtie, Store

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.[](key, context = {}) ⇒ Object



10
11
12
# File 'lib/wheel.rb', line 10

def [](key, context = {})
  Store[key, context]
end

.[]=(key, value) ⇒ Object



18
19
20
# File 'lib/wheel.rb', line 18

def []=(key, value)
  Store[key] = value
end

.attributesObject



30
31
32
33
34
35
36
37
# File 'lib/wheel.rb', line 30

def attributes
  @attributes ||= {
    user_id: {
      name: 'User ID',
      description: 'The unique identifier of the user'
    }
  }
end

.attributes=(attrs) ⇒ Object



26
27
28
# File 'lib/wheel.rb', line 26

def attributes=(attrs)
  @attributes = attrs
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Wheel)

    the object that the method was called on



22
23
24
# File 'lib/wheel.rb', line 22

def configure
  yield(self) if block_given?
end

.reloadObject



14
15
16
# File 'lib/wheel.rb', line 14

def reload
  Store.reload
end

.table_name_prefixObject



18
19
20
# File 'lib/wheel/engine.rb', line 18

def self.table_name_prefix
  'wheel_'
end