Class: FieldMapper::Types::Plat

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/field_mapper/types/plat.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, values = []) ⇒ Plat

Returns a new instance of Plat.



19
20
21
22
23
24
25
# File 'lib/field_mapper/types/plat.rb', line 19

def initialize(type, values=[])
  if type.class != Class || !type.ancestors.include?(FieldMapper::Standard::Plat)
    raise InvalidPlatType.new("#{type} is not a valid plat type")
  end

  @type = type
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/field_mapper/types/plat.rb', line 9

def type
  @type
end

Class Method Details

.[](type) ⇒ Object



13
14
15
# File 'lib/field_mapper/types/plat.rb', line 13

def [](type)
  Plat.new(type)
end

Instance Method Details

#nameObject



27
28
29
# File 'lib/field_mapper/types/plat.rb', line 27

def name
  self.class.name
end