Class: AgnosticBackend::Elasticsearch::RemoteIndexField

Inherits:
Object
  • Object
show all
Defined in:
lib/agnostic_backend/elasticsearch/remote_index_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, **args) ⇒ RemoteIndexField

Returns a new instance of RemoteIndexField.



8
9
10
11
12
# File 'lib/agnostic_backend/elasticsearch/remote_index_field.rb', line 8

def initialize(name, type, **args)
  @name = name
  @type = to_local type
  @options = args
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/agnostic_backend/elasticsearch/remote_index_field.rb', line 14

def method_missing(method_name)
  if @options.has_key? method_name
    @options[method_name]
  else
    super
  end
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/agnostic_backend/elasticsearch/remote_index_field.rb', line 6

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/agnostic_backend/elasticsearch/remote_index_field.rb', line 6

def type
  @type
end