Class: Caracal::Core::Models::BaseModel

Inherits:
Object
  • Object
show all
Defined in:
lib/caracal/core/models/base_model.rb

Overview

This class encapsulates the logic needed for functions that do not store or manipulate data.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, &block) ⇒ BaseModel

initialization



15
16
17
18
19
20
21
22
23
24
# File 'lib/caracal/core/models/base_model.rb', line 15

def initialize(options={}, &block)
  options.keep_if { |k,v| option_keys.include? k }
  options.each do |(key, value)|
    send(key, value)
  end
  
  if block_given?
    (block.arity < 1) ? instance_eval(&block) : block[self]
  end
end

Instance Method Details

#valid?Boolean

VALIDATION ===========================

Returns:

  • (Boolean)


33
34
35
# File 'lib/caracal/core/models/base_model.rb', line 33

def valid?
  true
end