Class: RubyReportable::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_reportable/source.rb

Instance Method Summary collapse

Constructor Details

#initializeSource

Returns a new instance of Source.



3
4
5
# File 'lib/ruby_reportable/source.rb', line 3

def initialize
  @options = {:filters => [], :as => :element}
end

Instance Method Details

#[](key) ⇒ Object



7
8
9
# File 'lib/ruby_reportable/source.rb', line 7

def [](key)
  @options[key]
end

#[]=(key, value) ⇒ Object



11
12
13
# File 'lib/ruby_reportable/source.rb', line 11

def []=(key, value)
  @options[key] = value
end

#as(variable_name) ⇒ Object



15
16
17
# File 'lib/ruby_reportable/source.rb', line 15

def as(variable_name)
  self[:as] = variable_name
end

#logic(&block) ⇒ Object



19
20
21
# File 'lib/ruby_reportable/source.rb', line 19

def logic(&block)
  self[:logic] = block
end