Class: RubyReport::Formatter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/ruby_report/formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj, scope = {}) ⇒ Formatter

Returns a new instance of Formatter.



7
8
9
10
# File 'lib/ruby_report/formatter.rb', line 7

def initialize(obj, scope = {})
  super(obj)
  @scope = scope
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



12
13
14
# File 'lib/ruby_report/formatter.rb', line 12

def method_missing(method, *args, &block)
  format(super)
end

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



5
6
7
# File 'lib/ruby_report/formatter.rb', line 5

def scope
  @scope
end

Instance Method Details

#format(value) ⇒ Object



20
21
22
# File 'lib/ruby_report/formatter.rb', line 20

def format(value)
  value
end

#respond_to_missing?(method, include_private) ⇒ Boolean

Returns:



16
17
18
# File 'lib/ruby_report/formatter.rb', line 16

def respond_to_missing?(method, include_private)
  super
end