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.



70
71
72
73
# File 'lib/applocale/Core/setting.rb', line 70

def initialize(sheetname, obj)
  self.sheetname = sheetname
  self.obj = obj
end

Instance Attribute Details

#objObject

Returns the value of attribute obj.



68
69
70
# File 'lib/applocale/Core/setting.rb', line 68

def obj
  @obj
end

#sheetnameObject

Returns the value of attribute sheetname.



68
69
70
# File 'lib/applocale/Core/setting.rb', line 68

def sheetname
  @sheetname
end

Class Method Details

.get_sheetlist(sheet_obj_list) ⇒ Object



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

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



84
85
86
87
88
89
90
91
# File 'lib/applocale/Core/setting.rb', line 84

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



75
76
77
# File 'lib/applocale/Core/setting.rb', line 75

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