Class: TecDoc::ArticleAttribute
- Inherits:
-
Object
- Object
- TecDoc::ArticleAttribute
- Defined in:
- lib/tec_doc/article_attribute.rb
Instance Attribute Summary collapse
-
#block_no ⇒ Object
Returns the value of attribute block_no.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_conditional ⇒ Object
Returns the value of attribute is_conditional.
-
#is_interval ⇒ Object
Returns the value of attribute is_interval.
-
#name ⇒ Object
Returns the value of attribute name.
-
#short_name ⇒ Object
Returns the value of attribute short_name.
-
#successor_id ⇒ Object
Returns the value of attribute successor_id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#unit ⇒ Object
Returns the value of attribute unit.
-
#value ⇒ Object
Returns the value of attribute value.
-
#value_id ⇒ Object
Returns the value of attribute value_id.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ArticleAttribute
constructor
A new instance of ArticleAttribute.
Constructor Details
#initialize(attributes = {}) ⇒ ArticleAttribute
Returns a new instance of ArticleAttribute.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/tec_doc/article_attribute.rb', line 5 def initialize(attributes = {}) attributes.each do |name, value| send("#{name.to_s.gsub(/^attr_/, '')}=", value) end @id = @id.to_i if @id @value_id = @value_id.to_i if @value_id @value = DateParser.new(@value).to_date if @type == "D" @is_interval = (@is_interval == "true") if @is_interval.is_a?(String) @is_conditional = (@is_conditional == "true") if @is_conditional.is_a?(String) end |
Instance Attribute Details
#block_no ⇒ Object
Returns the value of attribute block_no.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def block_no @block_no end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def id @id end |
#is_conditional ⇒ Object
Returns the value of attribute is_conditional.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def is_conditional @is_conditional end |
#is_interval ⇒ Object
Returns the value of attribute is_interval.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def is_interval @is_interval end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def name @name end |
#short_name ⇒ Object
Returns the value of attribute short_name.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def short_name @short_name end |
#successor_id ⇒ Object
Returns the value of attribute successor_id.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def successor_id @successor_id end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def type @type end |
#unit ⇒ Object
Returns the value of attribute unit.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def unit @unit end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def value @value end |
#value_id ⇒ Object
Returns the value of attribute value_id.
3 4 5 |
# File 'lib/tec_doc/article_attribute.rb', line 3 def value_id @value_id end |