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
-
#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)
211 212 213 |
# File 'lib/third_base/compat.rb', line 211 def ajd jd end |
#amjd ⇒ Object 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 |
#gregorian ⇒ Object 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.
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.
236 237 238 |
# File 'lib/third_base/compat.rb', line 236 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).
243 244 245 |
# File 'lib/third_base/compat.rb', line 243 def ld jd - LD_JD end |
#mday ⇒ Object
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 |
#start ⇒ Object 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 |