class ModelX::Base

Base ModelX class. Does nothing more than include {ModelX::Mixin} and define a constructor.

Public Class Methods

new(attributes = {}) { |self| ... } click to toggle source

Initializes the ModelX class by assigning all specified attributes.

@yield [self] Yields the new model if a block is given

# File lib/model_x/base.rb, line 12
def initialize(attributes = {})
  self.attributes = attributes if attributes.present?
  yield self if block_given?
end