Module: ThirdBase::CompatInstanceMethods

Included in:
Date, DateTime
Defined in:
lib/third_base/make_compat.rb

Overview

Compatibility instance methods for Date and DateTime, necessary because ruby doesn’t support multiple inheritance.

Instance Method Summary collapse

Instance Method Details

#ajdObject

Returns the Astronomical Julian Date for this date (alias for jd)



208
209
210
# File 'lib/third_base/make_compat.rb', line 208

def ajd
  jd
end

#amjdObject Also known as: mjd

Returns the Astronomical Modified Julian Date for this date (jd plus an integer)



213
214
215
# File 'lib/third_base/make_compat.rb', line 213

def amjd
  jd - MJD_JD
end

#gregorianObject Also known as: england, julian, italy

Returns self.



219
220
221
# File 'lib/third_base/make_compat.rb', line 219

def gregorian
  self
end

#gregorian?Boolean Also known as: ns?

True, since the gregorian calendar is always used.

Returns:

  • (Boolean)


227
228
229
# File 'lib/third_base/make_compat.rb', line 227

def gregorian?
  true
end

#julian?Boolean Also known as: os?

False, since the gregorian calendar is never used.

Returns:

  • (Boolean)


233
234
235
# File 'lib/third_base/make_compat.rb', line 233

def julian?
  false
end

#ldObject

Returns the days since the date of the adoption of the gregorian calendar in Italy (substracts an integer from jd).



240
241
242
# File 'lib/third_base/make_compat.rb', line 240

def ld
  jd - LD_JD
end

#mdayObject

Alias for day.



245
246
247
# File 'lib/third_base/make_compat.rb', line 245

def mday
  day
end

#new_start(sg = nil) ⇒ Object Also known as: newsg

Returns self, ignores sg.



250
251
252
# File 'lib/third_base/make_compat.rb', line 250

def new_start(sg=nil)
  self
end

#startObject Also known as: sg

Returns 0, since the gregorian calendar is always used.



256
257
258
# File 'lib/third_base/make_compat.rb', line 256

def start
  0
end