# Module StaticModel

- app/roles/static_model.rb

Provides an ActiveRecord-like interface to a model whose data is not persisted to a database.

Namespace

- MODULE StaticModel::ClassMethods

Methods

#
  - ==,
  - []
D
  - destroyed?
N
  - new_record?
P
  - persisted?
T
  - to_param

Instance Public methods
==(other) Link

Source: show

    # File app/roles/static_model.rb, line 40
    def ==(other)
      if other.is_a? StaticModel
        id == other.id
      else
        super
      end
    end

[](key) Link

Used by AR for fetching attributes

Pass it along if we respond to it.

Source: show

    # File app/roles/static_model.rb, line 20
    def [](key)
      send(key) if respond_to?(key)
    end

destroyed?() Link

Source: show

    # File app/roles/static_model.rb, line 36
    def destroyed?
      false
    end

new_record?() Link

Source: show

    # File app/roles/static_model.rb, line 28
    def new_record?
      false
    end

persisted?() Link

Source: show

    # File app/roles/static_model.rb, line 32
    def persisted?
      false
    end

to_param() Link

Source: show

    # File app/roles/static_model.rb, line 24
    def to_param
      id
    end