class Tracksperanto::Parameters::Parameter

Attributes

cast[RW]

The cast for the attribute (like :int or :float)

default[RW]

Default value of the attribute

desc[RW]

Attribute description for the UI

name[RW]

The name of the paramenter and the related object attribute

required[RW]

Whether the attribute is required

Public Instance Methods

apply_to(to_class) click to toggle source
# File lib/tracksperanto/parameters.rb, line 26
def apply_to(to_class)
  to_class.send(:attr_accessor, name)
  
  if cast
    cast_call = "cast_to_#{cast}"
    to_class.send(cast_call, name)
  end
  
  if required
    to_class.safe_reader name
  end
  
end