Class: Athena::Formats::XML::ElementSpec
- Defined in:
- lib/athena/formats/xml.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#record ⇒ Object
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(name, field, config) ⇒ ElementSpec
constructor
A new instance of ElementSpec.
- #start(context, name, attrs) ⇒ Object
- #text(context, data) ⇒ Object
Methods inherited from BaseSpec
Constructor Details
#initialize(name, field, config) ⇒ ElementSpec
Returns a new instance of ElementSpec.
234 235 236 237 |
# File 'lib/athena/formats/xml.rb', line 234 def initialize(name, field, config) super() @name, @field, @config = name, field, config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
231 232 233 |
# File 'lib/athena/formats/xml.rb', line 231 def config @config end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
231 232 233 |
# File 'lib/athena/formats/xml.rb', line 231 def field @field end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
231 232 233 |
# File 'lib/athena/formats/xml.rb', line 231 def name @name end |
#record ⇒ Object
Returns the value of attribute record.
232 233 234 |
# File 'lib/athena/formats/xml.rb', line 232 def record @record end |
Instance Method Details
#start(context, name, attrs) ⇒ Object
239 240 241 242 243 |
# File 'lib/athena/formats/xml.rb', line 239 def start(context, name, attrs) context = super self.record = Athena::Record[field, config] context end |
#text(context, data) ⇒ Object
245 246 247 248 249 |
# File 'lib/athena/formats/xml.rb', line 245 def text(context, data) context = super record.update(name, data) context end |