Class: Nockr::Atom
Instance Attribute Summary collapse
-
#i ⇒ Object
readonly
Returns the value of attribute i.
Attributes inherited from Noun
Instance Method Summary collapse
- #ary ⇒ Object
- #at(index:) ⇒ Object
- #atom? ⇒ Boolean
- #cell? ⇒ Boolean
-
#initialize(i) ⇒ Atom
constructor
A new instance of Atom.
Methods inherited from Noun
Constructor Details
#initialize(i) ⇒ Atom
Returns a new instance of Atom.
7 8 9 10 |
# File 'lib/nockr/atom.rb', line 7 def initialize(i) raise ArgumentError.new("an Atom must be initialized with a Natural Number") unless i.is_a? Integer @i = i end |
Instance Attribute Details
#i ⇒ Object (readonly)
Returns the value of attribute i.
5 6 7 |
# File 'lib/nockr/atom.rb', line 5 def i @i end |
Instance Method Details
#ary ⇒ Object
12 13 14 |
# File 'lib/nockr/atom.rb', line 12 def ary [self.i] end |
#at(index:) ⇒ Object
16 17 18 |
# File 'lib/nockr/atom.rb', line 16 def at(index:) self end |
#atom? ⇒ Boolean
20 21 22 |
# File 'lib/nockr/atom.rb', line 20 def atom? true end |
#cell? ⇒ Boolean
24 25 26 |
# File 'lib/nockr/atom.rb', line 24 def cell? false end |