Class: Cul::Image::Properties::Exif::FieldType

Inherits:
Object
  • Object
show all
Defined in:
lib/cul_image_props/image/properties/exif/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(length, abb, name, signed = false) ⇒ FieldType

Returns a new instance of FieldType.



8
9
10
11
12
13
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 8

def initialize(length, abb, name, signed=false)
  @length = length
  @abbreviation = abb
  @name = name
  @signed = signed
end

Instance Attribute Details

#abbreviationObject

Returns the value of attribute abbreviation.



7
8
9
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 7

def abbreviation
  @abbreviation
end

#lengthObject

Returns the value of attribute length.



7
8
9
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 7

def length
  @length
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 7

def name
  @name
end

#signedObject

Returns the value of attribute signed.



7
8
9
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 7

def signed
  @signed
end

Instance Method Details

#[](index) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 14

def [](index)
  case index
    when 0
      return @length
    when 1
      return @abbreviation
    when 2
      return @name
    else
      raise format("Unexpected index %s", index.to_s)
  end
end