Class: StaticStruct::Structure
- Inherits:
-
Object
- Object
- StaticStruct::Structure
- Defined in:
- lib/static_struct/structure.rb
Instance Attribute Summary collapse
-
#static_methods ⇒ Object
readonly
Returns the value of attribute static_methods.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(hash) ⇒ Structure
constructor
A new instance of Structure.
- #inspect ⇒ Object
Constructor Details
#initialize(hash) ⇒ Structure
Returns a new instance of Structure.
5 6 7 8 |
# File 'lib/static_struct/structure.rb', line 5 def initialize(hash) @static_methods = [] define_structure(self, hash) end |
Instance Attribute Details
#static_methods ⇒ Object (readonly)
Returns the value of attribute static_methods.
3 4 5 |
# File 'lib/static_struct/structure.rb', line 3 def static_methods @static_methods end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 |
# File 'lib/static_struct/structure.rb', line 17 def ==(other) inspect == other.inspect end |
#inspect ⇒ Object
10 11 12 13 14 15 |
# File 'lib/static_struct/structure.rb', line 10 def inspect methods = static_methods.sort.each_with_object({}) do |method, result| result[method] = public_send(method) end "#<#{self.class} #{methods}>" end |