Class: Zmanim::Limudim::Unit

Inherits:
Object
  • Object
show all
Defined in:
lib/zmanim/limudim/unit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#componentsObject (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

#renderObject



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_sObject



8
9
10
# File 'lib/zmanim/limudim/unit.rb', line 8

def to_s
  render{|value| value }
end