Class: Miti::BsToAd

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

Overview

class to handle the algorithm for converting AD to BS

Instance Method Summary collapse

Constructor Details

#initialize(nepali_date) ⇒ BsToAd

Creating an object of BsToAd requires a Miti::NepaliDate object

Parameters:



10
11
12
# File 'lib/miti/bs_to_ad.rb', line 10

def initialize(nepali_date)
  @nepali_date = nepali_date
end

Instance Method Details

#convertObject

Return equivalent english date for nepali date



15
16
17
# File 'lib/miti/bs_to_ad.rb', line 15

def convert
  corresponding_ad_for_baisakh1 + days_to_be_added_from_baisakh1
end