Class: Magiq::Types::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/magiq/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Type

Returns a new instance of Type.



30
31
32
# File 'lib/magiq/types.rb', line 30

def initialize(raw)
  @raw = raw.to_s.strip
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



24
25
26
# File 'lib/magiq/types.rb', line 24

def raw
  @raw
end

Class Method Details

.cast(raw) ⇒ Object



26
27
28
# File 'lib/magiq/types.rb', line 26

def self.cast(raw)
  new(raw).cast!
end

Instance Method Details

#cast!Object



34
35
36
# File 'lib/magiq/types.rb', line 34

def cast!
  raw
end