Class: Rstruct::Field
- Inherits:
-
Object
- Object
- Rstruct::Field
- Defined in:
- lib/rstruct/field.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#typ ⇒ Object
readonly
Returns the value of attribute typ.
Instance Method Summary collapse
-
#initialize(name, typ, args, block) ⇒ Field
constructor
A new instance of Field.
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to?(arg) ⇒ Boolean
Constructor Details
#initialize(name, typ, args, block) ⇒ Field
Returns a new instance of Field.
5 6 7 8 9 10 |
# File 'lib/rstruct/field.rb', line 5 def initialize(name, typ, args, block) @name=name @typ=typ @args=args @block=block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
16 17 18 |
# File 'lib/rstruct/field.rb', line 16 def method_missing(name, *args, &block) @typ.__send__(name, *args, &block) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/rstruct/field.rb', line 3 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
3 4 5 |
# File 'lib/rstruct/field.rb', line 3 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/rstruct/field.rb', line 3 def name @name end |
#typ ⇒ Object (readonly)
Returns the value of attribute typ.
3 4 5 |
# File 'lib/rstruct/field.rb', line 3 def typ @typ end |
Instance Method Details
#respond_to?(arg) ⇒ Boolean
12 13 14 |
# File 'lib/rstruct/field.rb', line 12 def respond_to?(arg) super(arg) || @typ.respond_to?(arg) end |