Class: ImageSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/image_spec.rb

Defined Under Namespace

Modules: Parser

Constant Summary collapse

Error =
Class.new(StandardError)

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ ImageSpec

Returns a new instance of ImageSpec.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/image_spec.rb', line 6

def initialize(file)
  @attributes = Parser.parse(stream_for(file))

  @attributes.each do |key, value|
    instance_eval <<-RUBY, __FILE__, __LINE__ + 1
      def #{key}
        @attributes[:#{key}]
      end
    RUBY
  end
end