Class: ConsolidatedScreeningList::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/consolidated_screening_list/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Result

Returns a new instance of Result.



5
6
7
# File 'lib/consolidated_screening_list/result.rb', line 5

def initialize(data)
  @data = data
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *arguments, &block) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/consolidated_screening_list/result.rb', line 13

def method_missing(method_name, *arguments, &block)
  if data.key?(method_name.to_s)
    data[method_name.to_s]
  else
    super
  end
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/consolidated_screening_list/result.rb', line 3

def data
  @data
end

Instance Method Details

#inspectObject



9
10
11
# File 'lib/consolidated_screening_list/result.rb', line 9

def inspect
  "#<ConsolidatedScreeningList::Result name=\"#{name}\">"
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
25
26
27
# File 'lib/consolidated_screening_list/result.rb', line 21

def respond_to_missing?(method_name, include_private = false)
  if data.key?(method_name.to_s)
    true
  else
    super
  end
end