class NeoScout::Constraints::PropConstraint

Attributes

name[R]
opt[R]
type[R]

Public Class Methods

new(args = {}) click to toggle source
Calls superclass method
# File lib/neoscout/constraints.rb, line 15
def initialize(args = {})
  super(args)
  @name  = args[:name]
  @opt   = args[:opt]
  @type  = args[:type]

  raise ArgumentError unless @name.kind_of? String
  raise ArgumentError unless @name.length > 0
end

Public Instance Methods

to_s() click to toggle source
# File lib/neoscout/constraints.rb, line 25
def to_s
  opt_s  = if @opt then " (opt.)" else '' end
  type_s = if @type then ": #{@type}" else '' end

  "#{@name}#{type_s}#{opt_s}"
end