Class: Magiq::Types::Type
- Inherits:
-
Object
- Object
- Magiq::Types::Type
- Defined in:
- lib/magiq/types.rb
Direct Known Subclasses
Bool, CategoryDepth, Date, EnumSort, Float, ID, Int, InventoryID, Latitude, Longitude, String, UPC, Whole
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
- #cast! ⇒ Object
-
#initialize(raw) ⇒ Type
constructor
A new instance of Type.
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
#raw ⇒ Object (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 |