Class: Applocale::Config::Sheet
- Inherits:
-
Object
- Object
- Applocale::Config::Sheet
- Defined in:
- lib/applocale/Core/setting.rb
Instance Attribute Summary collapse
-
#obj ⇒ Object
Returns the value of attribute obj.
-
#sheetname ⇒ Object
Returns the value of attribute sheetname.
Class Method Summary collapse
- .get_sheetlist(sheet_obj_list) ⇒ Object
- .get_sheetobj_by_sheetname(sheet_obj_list, sheetname) ⇒ Object
Instance Method Summary collapse
-
#initialize(sheetname, obj) ⇒ Sheet
constructor
A new instance of Sheet.
- #to_s ⇒ Object
Constructor Details
#initialize(sheetname, obj) ⇒ Sheet
Returns a new instance of Sheet.
75 76 77 78 |
# File 'lib/applocale/Core/setting.rb', line 75 def initialize(sheetname, obj) self.sheetname = sheetname self.obj = obj end |
Instance Attribute Details
#obj ⇒ Object
Returns the value of attribute obj.
73 74 75 |
# File 'lib/applocale/Core/setting.rb', line 73 def obj @obj end |
#sheetname ⇒ Object
Returns the value of attribute sheetname.
73 74 75 |
# File 'lib/applocale/Core/setting.rb', line 73 def sheetname @sheetname end |
Class Method Details
.get_sheetlist(sheet_obj_list) ⇒ Object
85 86 87 |
# File 'lib/applocale/Core/setting.rb', line 85 def self.get_sheetlist(sheet_obj_list) return sheet_obj_list.map{ |sheet_obj| sheet_obj.sheetname } end |
.get_sheetobj_by_sheetname(sheet_obj_list, sheetname) ⇒ Object
89 90 91 92 93 94 95 96 |
# File 'lib/applocale/Core/setting.rb', line 89 def self.get_sheetobj_by_sheetname(sheet_obj_list, sheetname) sheet_obj_list.each do |sheet_obj| if sheet_obj.sheetname == sheetname return sheet_obj.obj end end return nil end |
Instance Method Details
#to_s ⇒ Object
80 81 82 |
# File 'lib/applocale/Core/setting.rb', line 80 def to_s return "#{self.sheetname} #{self.obj.to_s}" end |