Class: Applocale::Config::Sheet

Inherits:
Object
  • Object
show all
Defined in:
lib/applocale/Core/setting.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#objObject

Returns the value of attribute obj.



73
74
75
# File 'lib/applocale/Core/setting.rb', line 73

def obj
  @obj
end

#sheetnameObject

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_sObject



80
81
82
# File 'lib/applocale/Core/setting.rb', line 80

def to_s
  return "#{self.sheetname}   #{self.obj.to_s}"
end