Class: Unstructured::Object
- Inherits:
-
Object
- Object
- Unstructured::Object
- Defined in:
- lib/unstructured/object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Object
constructor
A new instance of Object.
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to_missing?(_method, _include_private = false) ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Object
Returns a new instance of Object.
8 9 10 11 |
# File 'lib/unstructured/object.rb', line 8 def initialize(attributes) @raw_data = attributes @attributes = OpenStruct.new(attributes) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/unstructured/object.rb', line 6 def attributes @attributes end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
6 7 8 |
# File 'lib/unstructured/object.rb', line 6 def raw_data @raw_data end |
Instance Method Details
#respond_to_missing?(_method, _include_private = false) ⇒ Boolean
19 20 21 |
# File 'lib/unstructured/object.rb', line 19 def respond_to_missing?(_method, _include_private = false) true end |
#to_h ⇒ Object
23 24 25 |
# File 'lib/unstructured/object.rb', line 23 def to_h @raw_data end |