Class: Namaskar

Inherits:
Object
  • Object
show all
Defined in:
lib/namaskar.rb

Class Method Summary collapse

Class Method Details

.get_apiObject



16
17
18
19
20
# File 'lib/namaskar.rb', line 16

def self.get_api
  # Indico.api_key =  'abcd'
  deci = Indico.sentiment_hq(@text)
  @percentage = deci* 100;
end

.hiObject



6
7
8
# File 'lib/namaskar.rb', line 6

def self.hi
  puts "नमस्कार, Stay positive and happy"
end

.my_feelings(text) ⇒ Object



10
11
12
13
14
# File 'lib/namaskar.rb', line 10

def self.my_feelings(text)
  @text = text
  get_api
  return "Your day was #{@percentage}% happy and #{100 - @percentage}% sad"
end