Class: Halation::Config::Camera
- Inherits:
-
Object
- Object
- Halation::Config::Camera
- Defined in:
- lib/halation/config/camera.rb
Overview
A camera profile.
Instance Attribute Summary collapse
-
#lenses ⇒ Object
readonly
Returns the value of attribute lenses.
-
#make ⇒ Object
readonly
Returns the value of attribute make.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#tag ⇒ Object
readonly
A user-created ID.
Instance Method Summary collapse
-
#initialize(yaml) ⇒ Camera
constructor
A new instance of Camera.
- #to_s ⇒ String
Constructor Details
#initialize(yaml) ⇒ Camera
Returns a new instance of Camera.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/halation/config/camera.rb', line 14 def initialize(yaml) @tag = Coerce.string(yaml["tag"]) @make = Coerce.string(yaml["make"]) @model = Coerce.string(yaml["model"]) @lenses = [] yaml["lenses"].each do |lens| @lenses << Lens.new(lens) end end |
Instance Attribute Details
#lenses ⇒ Object (readonly)
Returns the value of attribute lenses.
12 13 14 |
# File 'lib/halation/config/camera.rb', line 12 def lenses @lenses end |
#make ⇒ Object (readonly)
Returns the value of attribute make.
10 11 12 |
# File 'lib/halation/config/camera.rb', line 10 def make @make end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
11 12 13 |
# File 'lib/halation/config/camera.rb', line 11 def model @model end |
#tag ⇒ Object (readonly)
A user-created ID.
9 10 11 |
# File 'lib/halation/config/camera.rb', line 9 def tag @tag end |
Instance Method Details
#to_s ⇒ String
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/halation/config/camera.rb', line 26 def to_s "Camera\n" << [ "Tag: #{tag}", "Make: #{make}", "Model: #{model}", @lenses.map(&:to_s).join("\n") ] .join("\n") .lines .map { |line| " #{line}" } .join end |