Class: Rwsc::ResultItem

Inherits:
Object
  • Object
show all
Defined in:
lib/rwsc/result_item.rb

Overview

this class is ResultItem base class .

Direct Known Subclasses

BooksTotalSearch, ItemSearch

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rwsc/result_item.rb', line 7

def method_missing(name, *args)
  @data_hash ||= {}

  method_name = name.to_s

  if method_name  =~ /(.*)=$/
    @data_hash[$1] = *args
  elsif args.nil? || args.empty?
    return  @data_hash[method_name]
  end

  nil
end