Class: Zmanim::Limudim::Unit
- Inherits:
-
Object
- Object
- Zmanim::Limudim::Unit
- Defined in:
- lib/zmanim/limudim/unit.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
Instance Method Summary collapse
-
#initialize(*components) ⇒ Unit
constructor
A new instance of Unit.
- #render ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(*components) ⇒ Unit
Returns a new instance of Unit.
4 5 6 |
# File 'lib/zmanim/limudim/unit.rb', line 4 def initialize(*components) @components = components end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
3 4 5 |
# File 'lib/zmanim/limudim/unit.rb', line 3 def components @components end |
Instance Method Details
#render ⇒ Object
12 13 14 15 16 17 |
# File 'lib/zmanim/limudim/unit.rb', line 12 def render primary, secondary = components.map do |component| Array(component).map{|v| yield v} end render_with_root(primary) + render_secondary(secondary, primary) end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/zmanim/limudim/unit.rb', line 8 def to_s render{|value| value } end |