Class: AsciiDataTools::RecordType::Type
- Inherits:
-
Object
- Object
- AsciiDataTools::RecordType::Type
- Extended by:
- Forwardable
- Defined in:
- lib/ascii-data-tools/record_type.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #field_with_name(name) ⇒ Object
- #filename_should_match(value) ⇒ Object
-
#initialize(name, content_fields = Field::Fields.new) ⇒ Type
constructor
A new instance of Type.
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
42 43 44 |
# File 'lib/ascii-data-tools/record_type.rb', line 42 def method_missing(method_name, *args, &block) content_fields.send(method_name, *args, &block) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/ascii-data-tools/record_type.rb', line 28 def name @name end |
Instance Method Details
#field_with_name(name) ⇒ Object
38 39 40 |
# File 'lib/ascii-data-tools/record_type.rb', line 38 def field_with_name(name) all_fields.with_name(name) end |
#filename_should_match(value) ⇒ Object
46 47 48 |
# File 'lib/ascii-data-tools/record_type.rb', line 46 def filename_should_match(value) field_with_name(:filename).should_be_constrained_to(value) end |