Class: Woody::Decorators::Submission

Inherits:
Base
  • Object
show all
Defined in:
lib/woody/decorators/submission.rb

Instance Method Summary collapse

Methods inherited from Base

#method_missing

Constructor Details

#initialize(model, config) ⇒ Submission

Returns a new instance of Submission.



8
9
10
11
# File 'lib/woody/decorators/submission.rb', line 8

def initialize(model, config)
  @config = config
  super(model)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Woody::Decorators::Base

Instance Method Details

#briefObject



13
14
15
16
17
18
# File 'lib/woody/decorators/submission.rb', line 13

def brief
  @brief ||= Woody::Decorators::Brief.new(
    Wes::Data::API::Brief.find(:id, @model.brief_id),
    @config
  )
end

#titleObject



20
21
22
23
24
# File 'lib/woody/decorators/submission.rb', line 20

def title
  format(
    '%s - %s', brief.brand.name, brief.title
  )
end