Class: Resulang::Fields::PointList
- Inherits:
-
Object
- Object
- Resulang::Fields::PointList
- Defined in:
- lib/resulang/fields.rb
Instance Attribute Summary collapse
-
#points ⇒ Object
readonly
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(string: nil, &block) ⇒ PointList
constructor
A new instance of PointList.
- #point(string, &block) ⇒ Object
- #to_s ⇒ Object
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
#points ⇒ Object (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_s ⇒ Object
26 27 28 |
# File 'lib/resulang/fields.rb', line 26 def to_s @string end |