Module: Roseflow::Pinecone::Vectors::Common

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base_class) ⇒ Object



7
8
9
# File 'lib/roseflow/pinecone/vectors/common.rb', line 7

def self.extended(base_class)
  base_class.extend ClassMethods
end

.included(base_class) ⇒ Object



11
12
13
# File 'lib/roseflow/pinecone/vectors/common.rb', line 11

def self.included(base_class)
  base_class.extend ClassMethods
end

Instance Method Details

#to_jsonObject



26
27
28
29
30
31
32
# File 'lib/roseflow/pinecone/vectors/common.rb', line 26

def to_json
  to_h.map do |key, value|
    [key.to_s.split("_").map.with_index do |word, index|
      index == 0 ? word : word.capitalize
    end.join.to_sym, value]
  end.to_h.to_json
end