Class: EasyJSONMatcher::ContentWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_json_matcher/content_wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ ContentWrapper

Returns a new instance of ContentWrapper.



6
7
8
# File 'lib/easy_json_matcher/content_wrapper.rb', line 6

def initialize(content)
  @content = content
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



14
15
16
# File 'lib/easy_json_matcher/content_wrapper.rb', line 14

def method_missing(method, *args)
  content.send(method, *args)
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



4
5
6
# File 'lib/easy_json_matcher/content_wrapper.rb', line 4

def content
  @content
end

Instance Method Details

#[](key) ⇒ Object



10
11
12
# File 'lib/easy_json_matcher/content_wrapper.rb', line 10

def [](key)
  content[key.to_s]
end