Module: ThirdBase::CompatInstanceMethods

Defined in:
lib/third_base/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)



211
212
213
# File 'lib/third_base/compat.rb', line 211

def ajd
  jd
end

#amjdObject Also known as: mjd

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



216
217
218
# File 'lib/third_base/compat.rb', line 216

def amjd
  jd - MJD_JD
end

#gregorianObject Also known as: england, julian, italy

Returns self.



222
223
224
# File 'lib/third_base/compat.rb', line 222

def gregorian
  self
end

#gregorian?Boolean Also known as: ns?

True, since the gregorian calendar is always used.

Returns:

  • (Boolean)


230
231
232
# File 'lib/third_base/compat.rb', line 230

def gregorian?
  true
end

#julian?Boolean Also known as: os?

False, since the gregorian calendar is never used.

Returns:

  • (Boolean)


236
237
238
# File 'lib/third_base/compat.rb', line 236

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).



243
244
245
# File 'lib/third_base/compat.rb', line 243

def ld
  jd - LD_JD
end

#mdayObject

Alias for day.



248
249
250
# File 'lib/third_base/compat.rb', line 248

def mday
  day
end

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

Returns self, ignores sg.



253
254
255
# File 'lib/third_base/compat.rb', line 253

def new_start(sg=nil)
  self
end

#startObject Also known as: sg

Returns 0, since the gregorian calendar is always used.



259
260
261
# File 'lib/third_base/compat.rb', line 259

def start
  0
end