Class: Zermelo::Associations::IndexData

Inherits:
Object
  • Object
show all
Defined in:
lib/zermelo/associations/index_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ IndexData

Returns a new instance of IndexData.



7
8
9
10
11
# File 'lib/zermelo/associations/index_data.rb', line 7

def initialize(opts = {})
  [:name, :type, :index_klass].each do |a|
    send("#{a}=".to_sym, opts[a])
  end
end

Instance Attribute Details

#data_klass_name=(value) ⇒ Object (writeonly)

Sets the attribute data_klass_name

Parameters:

  • value

    the value to set the attribute data_klass_name to.



4
5
6
# File 'lib/zermelo/associations/index_data.rb', line 4

def data_klass_name=(value)
  @data_klass_name = value
end

#index_klassObject

Returns the value of attribute index_klass.



5
6
7
# File 'lib/zermelo/associations/index_data.rb', line 5

def index_klass
  @index_klass
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/zermelo/associations/index_data.rb', line 5

def name
  @name
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/zermelo/associations/index_data.rb', line 5

def type
  @type
end

Instance Method Details

#data_klassObject



13
14
15
# File 'lib/zermelo/associations/index_data.rb', line 13

def data_klass
  @data_klass ||= @data_klass_name.constantize
end