Class: TypecastedOpenStruct::Element
- Inherits:
-
Object
- Object
- TypecastedOpenStruct::Element
- Defined in:
- lib/typecasted_open_struct.rb
Instance Attribute Summary collapse
-
#attr_type ⇒ Object
Returns the value of attribute attr_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, attr_type = String, options = {}) ⇒ Element
constructor
A new instance of Element.
- #method_name ⇒ Object
Constructor Details
#initialize(name, attr_type = String, options = {}) ⇒ Element
Returns a new instance of Element.
71 72 73 74 75 |
# File 'lib/typecasted_open_struct.rb', line 71 def initialize(name, attr_type=String, ={}) self.name = name.to_s self.attr_type = attr_type self. = end |
Instance Attribute Details
#attr_type ⇒ Object
Returns the value of attribute attr_type.
69 70 71 |
# File 'lib/typecasted_open_struct.rb', line 69 def attr_type @attr_type end |
#name ⇒ Object
Returns the value of attribute name.
69 70 71 |
# File 'lib/typecasted_open_struct.rb', line 69 def name @name end |
#namespace ⇒ Object
Returns the value of attribute namespace.
69 70 71 |
# File 'lib/typecasted_open_struct.rb', line 69 def namespace @namespace end |
#options ⇒ Object
Returns the value of attribute options.
69 70 71 |
# File 'lib/typecasted_open_struct.rb', line 69 def @options end |
Instance Method Details
#method_name ⇒ Object
77 78 79 |
# File 'lib/typecasted_open_struct.rb', line 77 def method_name @method_name ||= name.tr('-', '_') end |