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
Methods included from Util
Constructor Details
#initialize(name, field, config) ⇒ ElementSpec
Returns a new instance of ElementSpec.
237 238 239 240 241 242 243 |
# File 'lib/athena/formats/xml.rb', line 237 def initialize(name, field, config) super() @name = name @field = field @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
234 235 236 |
# File 'lib/athena/formats/xml.rb', line 234 def config @config end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
234 235 236 |
# File 'lib/athena/formats/xml.rb', line 234 def field @field end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
234 235 236 |
# File 'lib/athena/formats/xml.rb', line 234 def name @name end |
#record ⇒ Object
Returns the value of attribute record.
235 236 237 |
# File 'lib/athena/formats/xml.rb', line 235 def record @record end |
Instance Method Details
#start(context, name, attrs) ⇒ Object
245 246 247 248 249 |
# File 'lib/athena/formats/xml.rb', line 245 def start(context, name, attrs) super self.record = Athena::Record[field, config] end |
#text(context, data) ⇒ Object
251 252 253 254 255 |
# File 'lib/athena/formats/xml.rb', line 251 def text(context, data) super record.update(name, data) end |