Class: Peictt::Builder::Template
- Defined in:
- lib/peictt/builder/template.rb
Constant Summary collapse
- FORMAT =
[:json, :text].freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#arg ⇒ Object
readonly
Returns the value of attribute arg.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#locals ⇒ Object
readonly
Returns the value of attribute locals.
Instance Method Summary collapse
- #html? ⇒ Boolean
-
#initialize(args, controller_name, action) ⇒ Template
constructor
A new instance of Template.
- #json? ⇒ Boolean
- #text? ⇒ Boolean
Constructor Details
#initialize(args, controller_name, action) ⇒ Template
Returns a new instance of Template.
7 8 9 10 11 12 |
# File 'lib/peictt/builder/template.rb', line 7 def initialize(args, controller_name, action) @arg = args @action = action @controller = controller_name process_args arg.dup end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
4 5 6 |
# File 'lib/peictt/builder/template.rb', line 4 def action @action end |
#arg ⇒ Object (readonly)
Returns the value of attribute arg.
4 5 6 |
# File 'lib/peictt/builder/template.rb', line 4 def arg @arg end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/peictt/builder/template.rb', line 4 def body @body end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
4 5 6 |
# File 'lib/peictt/builder/template.rb', line 4 def format @format end |
#locals ⇒ Object (readonly)
Returns the value of attribute locals.
4 5 6 |
# File 'lib/peictt/builder/template.rb', line 4 def locals @locals end |
Instance Method Details
#html? ⇒ Boolean
14 15 16 |
# File 'lib/peictt/builder/template.rb', line 14 def html? @format == :html end |
#json? ⇒ Boolean
18 19 20 |
# File 'lib/peictt/builder/template.rb', line 18 def json? @format == :json end |
#text? ⇒ Boolean
22 23 24 |
# File 'lib/peictt/builder/template.rb', line 22 def text? @format == :text end |