forked from pauldix/sax-machine
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to support also pulling the element value out along side attr…
…ibutes
- Loading branch information
1 parent
ed2c901
commit 15adc32
Showing
5 changed files
with
133 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module SAXMachine | ||
class SAXConfig | ||
|
||
class ElementValueConfig | ||
attr_reader :name, :setter | ||
|
||
def initialize(name, options) | ||
@name = name.to_s | ||
@as = options[:as] | ||
@setter = "#{@as}=" | ||
@required = options[:required] | ||
end | ||
|
||
def column | ||
@as || @name.to_sym | ||
end | ||
|
||
def required? | ||
@required | ||
end | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters