Class: Resulang::Fields::PointList

Inherits:
Object
  • Object
show all
Defined in:
lib/resulang/fields.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string: nil, &block) ⇒ PointList

Returns a new instance of PointList.



16
17
18
19
20
# File 'lib/resulang/fields.rb', line 16

def initialize(string: nil, &block)
  @string = string
  @points = [ ]
  instance_eval(&block) if block
end

Instance Attribute Details

#pointsObject (readonly)

Returns the value of attribute points.



14
15
16
# File 'lib/resulang/fields.rb', line 14

def points
  @points
end

Instance Method Details

#point(string, &block) ⇒ Object



22
23
24
# File 'lib/resulang/fields.rb', line 22

def point(string, &block)
  points.push(PointList.new(string: string, &block))
end

#to_sObject



26
27
28
# File 'lib/resulang/fields.rb', line 26

def to_s
  @string
end