Class: PrayerTimes::CalculationMethod
- Inherits:
-
Object
- Object
- PrayerTimes::CalculationMethod
- Defined in:
- lib/prayer_times/calculation_method.rb
Overview
Calculation method instances and logic is encapsulated here
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#offsets ⇒ Object
Returns the value of attribute offsets.
-
#settings ⇒ Object
Returns the value of attribute settings.
Class Method Summary collapse
-
.default_settings ⇒ Object
Default settings.
Instance Method Summary collapse
-
#initialize(name, description, settings = {}, offsets = {}) ⇒ CalculationMethod
constructor
Initializer.
-
#to_s ⇒ Object
Readable representation of this object.
Constructor Details
#initialize(name, description, settings = {}, offsets = {}) ⇒ CalculationMethod
Initializer
52 53 54 55 56 57 |
# File 'lib/prayer_times/calculation_method.rb', line 52 def initialize(name,description,settings={}, offsets = {}) self.name = name self.description = description self.settings = settings self.offsets = offsets end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/prayer_times/calculation_method.rb', line 5 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/prayer_times/calculation_method.rb', line 5 def name @name end |
#offsets ⇒ Object
Returns the value of attribute offsets.
5 6 7 |
# File 'lib/prayer_times/calculation_method.rb', line 5 def offsets @offsets end |
#settings ⇒ Object
Returns the value of attribute settings.
5 6 7 |
# File 'lib/prayer_times/calculation_method.rb', line 5 def settings @settings end |
Class Method Details
.default_settings ⇒ Object
Default settings
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/prayer_times/calculation_method.rb', line 9 def self.default_settings { imsak: '10 min', dhuhr: '0 min', asr: 'Standard', maghrib: '0 min', midnight: 'Standard', high_lats: 'NightMiddle' } end |
Instance Method Details
#to_s ⇒ Object
Returns readable representation of this object.
77 78 79 |
# File 'lib/prayer_times/calculation_method.rb', line 77 def to_s name end |