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.
228 229 230 231 232 233 234 |
# File 'lib/athena/formats/xml.rb', line 228 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.
225 226 227 |
# File 'lib/athena/formats/xml.rb', line 225 def config @config end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
225 226 227 |
# File 'lib/athena/formats/xml.rb', line 225 def field @field end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
225 226 227 |
# File 'lib/athena/formats/xml.rb', line 225 def name @name end |
#record ⇒ Object
Returns the value of attribute record.
226 227 228 |
# File 'lib/athena/formats/xml.rb', line 226 def record @record end |
Instance Method Details
#start(context, name, attrs) ⇒ Object
236 237 238 239 240 |
# File 'lib/athena/formats/xml.rb', line 236 def start(context, name, attrs) super self.record = Athena::Record[field, config] end |
#text(context, data) ⇒ Object
242 243 244 245 246 |
# File 'lib/athena/formats/xml.rb', line 242 def text(context, data) super record.update(name, data) end |