Module: ThirdBase::CompatInstanceMethods
Overview
Compatibility instance methods for Date and DateTime, necessary because ruby doesn’t support multiple inheritance.
Instance Method Summary collapse
-
#ajd ⇒ Object
Returns the Astronomical Julian Date for this date (alias for jd).
-
#amjd ⇒ Object
(also: #mjd)
Returns the Astronomical Modified Julian Date for this date (jd plus an integer).
-
#gregorian ⇒ Object
(also: #england, #julian, #italy)
Returns self.
-
#gregorian? ⇒ Boolean
(also: #ns?)
True, since the gregorian calendar is always used.
-
#julian? ⇒ Boolean
(also: #os?)
False, since the gregorian calendar is never used.
-
#ld ⇒ Object
Returns the days since the date of the adoption of the gregorian calendar in Italy (substracts an integer from jd).
-
#mday ⇒ Object
Alias for day.
-
#new_start(sg = nil) ⇒ Object
(also: #newsg)
Returns self, ignores sg.
-
#start ⇒ Object
(also: #sg)
Returns 0, since the gregorian calendar is always used.
Instance Method Details
#ajd ⇒ Object
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 |
#amjd ⇒ Object 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 |
#gregorian ⇒ Object 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.
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.
233 234 235 |
# File 'lib/third_base/make_compat.rb', line 233 def julian? false end |
#ld ⇒ Object
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 |
#mday ⇒ Object
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 |
#start ⇒ Object 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 |