Class: Halation::Config::Lens

Inherits:
Object
  • Object
show all
Defined in:
lib/halation/config/lens.rb

Overview

A lens profile.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml) ⇒ Lens

Returns a new instance of Lens.



12
13
14
15
16
# File 'lib/halation/config/lens.rb', line 12

def initialize(yaml)
  @tag = Coerce.string(yaml["tag"])
  @model = Coerce.string(yaml["model"])
  @focal_length = Coerce.integer(yaml["focal_length"])
end

Instance Attribute Details

#focal_lengthObject (readonly)

Returns the value of attribute focal_length.



10
11
12
# File 'lib/halation/config/lens.rb', line 10

def focal_length
  @focal_length
end

#modelObject (readonly)

Returns the value of attribute model.



9
10
11
# File 'lib/halation/config/lens.rb', line 9

def model
  @model
end

#tagObject (readonly)

A user-created ID.



8
9
10
# File 'lib/halation/config/lens.rb', line 8

def tag
  @tag
end

Instance Method Details

#to_sString

Returns:

  • (String)


19
20
21
22
23
24
25
26
27
28
# File 'lib/halation/config/lens.rb', line 19

def to_s
  "Lens\n" <<
  [
    "Tag: #{tag}",
    "Model: #{model}",
    "Focal Length: #{focal_length}",
  ]
    .map { |line| "   #{line}" }
    .join("\n")
end