Class: Coppola::Actor

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/coppola/actor.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/coppola/actor.rb', line 8

def name
  @name
end

Class Method Details

.build(name, options, &block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/coppola/actor.rb', line 11

def self.build name, options, &block
  parent = self
  if options[:parent]
    actor = Coppola.actor_by_name(options[:parent])
    parent = actor if actor
  end
  klass = Class.new(parent) do
    instance_eval(&block) if block_given?
  end
  klass.name = name
  klass
end