Class: Postful::Postcard::Document

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_name) ⇒ Document

Returns a new instance of Document.



103
104
105
106
# File 'lib/postful/postcard.rb', line 103

def initialize(template_name)
  @template_name = template_name
  @sections = []
end

Instance Attribute Details

#sectionsObject

Returns the value of attribute sections.



101
102
103
# File 'lib/postful/postcard.rb', line 101

def sections
  @sections
end

Instance Method Details

#build_request(builder) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/postful/postcard.rb', line 112

def build_request(builder)
  builder.document do
    builder.template do 
      builder.source 'gallery'
      builder.name @template_name
    end
    builder.sections do 
      sections.each do |section|
        section.build_request(builder)
      end
    end          
  end
end

#requires_upload?Boolean

Returns:

  • (Boolean)


108
109
110
# File 'lib/postful/postcard.rb', line 108

def requires_upload?
  false
end