Class: RBarcode::Base
- Inherits:
-
Object
- Object
- RBarcode::Base
- Defined in:
- lib/rbarcode/base.rb
Instance Attribute Summary collapse
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#text ⇒ Object
writeonly
Sets the attribute text.
Instance Method Summary collapse
-
#code39 ⇒ Object
Initializes an instance of RBarcode::Code39 with the same instance variables as the base object.
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
-
#postnet ⇒ Object
Initializes an instance of RBarcode::Postnet with the same instance variables as the base object.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rbarcode/base.rb', line 17 def initialize( = {}) prefs = File.([:prefs] || "~/.rbarcode.yml") YAML.load(File.open(prefs)).each {|pref, value| eval("@#{pref} = #{value.inspect}")} if File.exists?(prefs) @required = Array.new # include all provided data .each do |method, value| instance_variable_set("@#{method}", value) end end |
Instance Attribute Details
#required ⇒ Object (readonly)
Returns the value of attribute required.
13 14 15 |
# File 'lib/rbarcode/base.rb', line 13 def required @required end |
#text=(value) ⇒ Object (writeonly)
Sets the attribute text
15 16 17 |
# File 'lib/rbarcode/base.rb', line 15 def text=(value) @text = value end |