Class: Rack::API::Formatter::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/api/formatter/base.rb

Direct Known Subclasses

Jsonp

Defined Under Namespace

Classes: AbstractMethodError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, env, params) ⇒ Base

Returns a new instance of Base.



11
12
13
# File 'lib/rack/api/formatter/base.rb', line 11

def initialize(object, env, params)
  @object, @env, @params = object, env, params
end

Instance Attribute Details

#envObject

Returns the value of attribute env.



7
8
9
# File 'lib/rack/api/formatter/base.rb', line 7

def env
  @env
end

#objectObject

Returns the value of attribute object.



5
6
7
# File 'lib/rack/api/formatter/base.rb', line 5

def object
  @object
end

#paramsObject

Returns the value of attribute params.



6
7
8
# File 'lib/rack/api/formatter/base.rb', line 6

def params
  @params
end

Instance Method Details

#to_formatObject



15
16
17
# File 'lib/rack/api/formatter/base.rb', line 15

def to_format
  raise AbstractMethodError
end