lib/lotus/view/dsl.rb
def format(value = nil)
        if value.nil?
          @format
        else
          @format = value
        end
      end
# When a value is given, specify the handled format.
# Otherwise, it returns the previously specified format.
#
# @param value [Symbol] the format
#
# @return [Symbol, nil] the specified format for this view, if set
#
# @since 0.1.0
#
# @example
#   require 'lotus/view'
#
#   module Articles
#     class Show
#       include Lotus::View
#     end
#
#     class JsonShow < Show
#       format :json
#     end
#   end
#
#   Articles::Show.format     # => nil
#   Articles::JsonShow.format # => :json
When a value is given, specify the handled format.
Otherwise, it returns the previously specified format.
When a value is given specify the handled format . Otherwise it returns the previously specified format .
def format(value = nil)
        if value.nil?
          @format
        else
          @format = value
        end
      end
def format ( value = nil ) if value . nil? @format else @format = value end end
When a value is given, specify the handled format.
When a value is given specify the handled format .
the specified format for this view, if set
the specified format for this view if set
Symbol, nil
value
None
since
None
example
require 'lotus/view' module Articles class Show include Lotus::View end class JsonShow < Show format :json end end Articles::Show.format # => nil Articles::JsonShow.format # => :json
require ' lotus / view ' module Articles class Show include Lotus :: View end class JsonShow < Show format : json end end Articles :: Show . format # = > nil Articles :: JsonShow . format # = > : json