Class: Extentions::Base::Extention

Inherits:
Object
  • Object
show all
Defined in:
lib/extentions/base/extention.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.apply(*params) ⇒ Object



7
8
9
10
# File 'lib/extentions/base/extention.rb', line 7

def self.apply(*params)
  extention = new(*params)
  extention.valid? ? extention : Null::Extention.new
end

.configObject



16
17
18
# File 'lib/extentions/base/extention.rb', line 16

def self.config
  @config ||= OpenStruct.new
end

.configure(&block) ⇒ Object



12
13
14
# File 'lib/extentions/base/extention.rb', line 12

def self.configure(&block)
  block.call(config)
end

Instance Method Details

#processObject



24
25
26
# File 'lib/extentions/base/extention.rb', line 24

def process
  router.process
end

#renderObject



20
21
22
# File 'lib/extentions/base/extention.rb', line 20

def render
  router.render
end

#to_tokenObject



28
29
30
31
# File 'lib/extentions/base/extention.rb', line 28

def to_token
  self.class.name.split("::").at(1).downcase.to_sym
  # Naming.new(self).tokens.last
end

#valid?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/extentions/base/extention.rb', line 33

def valid?(*)
  raise NotImplementedError
end