Class: SistemKebut::Paragraph::MejaSekat::Unit
- Inherits:
-
Object
- Object
- SistemKebut::Paragraph::MejaSekat::Unit
- Defined in:
- lib/sks/paragraph/mejasekat.rb
Defined Under Namespace
Classes: JumlahKolomTidakSama
Instance Attribute Summary collapse
-
#konten ⇒ Object
Returns the value of attribute konten.
-
#setelan ⇒ Object
readonly
Returns the value of attribute setelan.
Instance Method Summary collapse
- #[](id) ⇒ Object
-
#initialize(kolom, *args) ⇒ Unit
constructor
A new instance of Unit.
- #tiap(&block) ⇒ Object
Constructor Details
#initialize(kolom, *args) ⇒ Unit
Returns a new instance of Unit.
17 18 19 20 21 22 23 |
# File 'lib/sks/paragraph/mejasekat.rb', line 17 def initialize(kolom, *args) berat = args.clone @setelan = berat.last.kind_of?(Hash) ? berat.pop : Hash.new kini = berat.length raise JumlahKolomTidakSama.new(kini, kolom) if kini != kolom @konten = berat end |
Instance Attribute Details
#konten ⇒ Object
Returns the value of attribute konten.
14 15 16 |
# File 'lib/sks/paragraph/mejasekat.rb', line 14 def konten @konten end |
#setelan ⇒ Object (readonly)
Returns the value of attribute setelan.
15 16 17 |
# File 'lib/sks/paragraph/mejasekat.rb', line 15 def setelan @setelan end |
Instance Method Details
#[](id) ⇒ Object
25 26 27 |
# File 'lib/sks/paragraph/mejasekat.rb', line 25 def [](id) @konten[id] end |
#tiap(&block) ⇒ Object
29 30 31 |
# File 'lib/sks/paragraph/mejasekat.rb', line 29 def tiap(&block) @konten.each(&block) end |