Sha256: bea8f36a2a984056cfd615310e1082ffd47ee733b2874fae75bf437d3acd33be

Contents?: true

Size: 937 Bytes

Versions: 12

Compression:

Stored size: 937 Bytes

Contents

#_class_methods.erb
  class << self
    def attributes
      @attributes ||= HashWithIndifferentAccess.new(<%= attributes_with_defaults.map {|key,value| %Q[#{key}: #{value.inspect}]}.join(", ") %>).merge(super)
    end

    def types
      @types ||= ActiveMocker::HashProcess.new(<%= types_hash %>, method(:build_type)).merge(super)
    end

    def associations
      @associations ||= <%= associations %>.merge(super)
    end

    def associations_by_class
      @associations_by_class ||= <%= associations_by_class %>.merge(super)
    end

    def mocked_class
      <%= mocked_class.inspect %>
    end

    private :mocked_class

    def attribute_names
      @attribute_names ||= attributes.stringify_keys.keys
    end

    def primary_key
      <%= primary_key.name.inspect %>
    end

    def abstract_class?
      <%= abstract_class.inspect %>
    end

    def table_name
      <%= table_name.inspect %> || super
    end

  end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
active_mocker-2.4.0.pre5 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.3.4 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.4.0.pre4 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.4.0.pre3 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.4.0.pre2 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.4.0.pre1 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.3.3 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.3.2 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.3.1 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.3.0 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.2.5 lib/active_mocker/mock_template/_class_methods.erb
active_mocker-2.2.4 lib/active_mocker/mock_template/_class_methods.erb